I am trying to call using Twilio Client in Twilio Console getting the below
Error - 52162
Credentials do not belong to used account
description "Unauthorized: Credential CR62376047c277240bf110833a73b0f09e does not belong to Account ACe60123e1458ba461d6a1951aeca761e1"
I am using the push credential which I created, but for some reason the app keeps using an old one that isn't in my account.
This "CR62376047c277240bf110833a73b0f09e" is not my push credential. I have changed the environment variable with my push credential SID and still the app seems to be using this one from somewhere.
How do I fix this? Thanks!
Related
I am using stripe in my app.
There is a function in in app which is used to create charge from card to company account registered in our site.
It usually works fine and all payments are completed but sometimes it says no such token found.
I am creating token just before creating charge and code is something like that:
token = Stripe:Token:Create({
customer: stripe_customer_id
}, company_stripe_secret_key).id
#please ignore the syntax or any error as it works fine and I am writing it on mobile
#purpose of code it to tell you that how follow works
And just after that I am creating charge and when charge request goes it returns no such token "token_returned_by_stripe"
How is it possible? Stripe is returning the token and I am using that token and it says no such token....???
Your code snippet there is cloning a Token from the Platform, on to the Connect account. You are most likely creating a Direct Charge (on the Connect account) after that code snippet.
There are a few reasons you would be getting this error, for example you could be cloning the Token on acct_1 but creating the Charge on acct_2, or not cloning at all but trying to use the Platform Token directly on a Connect account, etc.
But really it boils down to that your code has a Token on one account but is trying to use it on a different account. You should troubleshoot and debug your code by adding logs to see which Tokens are being created and on which account you try to create the Charge.
I have a web app with following 3-step flow using Twilio Verify for email verification:
Creating verification code with Verify
Checking verification code with Verify
Create user account in my web api
After a successful Twilio Verify verification code check (step 2), I need to be able to do another Twilio Verfy call to ensure that the email was verified before a user account is actually created in my web api (step 3). But since the SID is deleted after successful email verification, I get following answer for a GET request to:
https://verify.twilio.com/v2/Services/{ServiceSid}/Verifications/{Sid}
{
"code": 20404,
"message": "The requested resource /Services/VAxxx/Verifications/VExxx was not found",
"more_info": "https://www.twilio.com/docs/errors/20404",
"status": 404
}
Now, for the Frontend, it's easy: I move to the final account creation step only if the email was verified successfully.
But, for a true stateless Backend, after accepting the Frontend request I first need to double-check with Twilio if the email was actually already verified.
True stateless in the sense that I do not want to store in a DB if an email was already verified or not. (This is already done by Twilio)
How can I do that? I didn't find the right API in the Twilio documetaion.
Twilio developer evangelist here.
I understand that you would like to get the information that appears available in the logs, however that is not available through the API. Once a verification has succeeded (or timed out after 10 minutes, or reached the maximum number of incorrect attempts) it is deleted and you can no longer access it through the API. I assume this is to prevent replay attacks, but I’m not on that team, so don’t know all the reasons behind it.
The result of this is that you cannot call on the verification check more than once from your code.
You will have to store the state within your own system because the API will not store that state for you. Much like during login with 2FA you would need to store the state that a password had been successfully entered.
I am trying to log into my youtube account to access and build a reporting job. Trouble is I set up the Web Application, and set up the OAuth consent screen with the name of the application and am getting a 401. That’s an error.
Error: deleted_client
The OAuth client was deleted.
I've already tried renaming the product name to the application name, and have an email set up. Other than that, nothing on the web really answers the question.
This is the image of the error that i'm seeing
I'm implementing a webapp that connects to Dynamics365 via webapi. Therefore I'm using Azure Active Directory for oAuth. I'm getting the following error and I'm not sure where is something going wrong. Therefore I'm describing my whole procedure:
"error":"invalid_client",
"error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.
Trace ID: 2cc92fcd-798b-4636-892d-0c3c397c0401
Correlation ID: f3bd2f4c-05c5-4de8-ace2-acf4b99e6fb9
Timestamp: 2018-09-19 09:43:38Z",
"error_codes":[70002,50012],
"timestamp":"2018-09-19 09:43:38Z",
"trace_id":"2cc92fcd-798b-4636-892d-0c3c397c0401",
"correlation_id":"f3bd2f4c-05c5-4de8-ace2-acf4b99e6fb9"
I'm using these urls including the tenant. I got got them from the Azure Portal / Azure Active Directory / App Registration:
https://login.microsoftonline.com/{tenant}/oauth2/authorize
https://login.microsoftonline.com/{tenant}/oauth2/token
I registered a new app in the App Registration. I used the app ID and created a key that I used as client_secret. Calling the authorize-url is working fine! Then it is redirected to my callback.
Then I'm getting a code that I try to use to get a token. But it returns the error mentioned above. Input for POST-request to /oauth2/token is the following:
grant_type=authorization_code&
client_id={same as for authorize}&
code={returned code from authorize}&
redirect_uri={the callback of my webapp}&
resource={also callback-url}&
client_secret={the key from the keys-section in App Registration}
I'm looking forward to any ideas!
A few things you can try:
As Sunny suggested in the comments, a simple step would be to create a new key in the app registration and try that one.
Make sure that you have the Client Secret in your config or app settings matches exactly what you have in the portal. Also make sure that you don't somehow have duplicate app settings that could be overwriting each other.
From this similar discussion on MSDN:
Go to https://identity.microsoft.com login, and then select your app.
Click on "Generate New Password"
Use that value as the client_secret parameter.
I've successfully setup my hub to use an SSL certificate per app, but I'd really like to move to the token-based APNs Auth Key approach. I configured my hub with I believe all the right information from the p8 file. For Key ID, I put in the 10-character value from when key was generated. For App ID, I put in my Team ID. For Token, I put in the private key value from the p8 file.
Has anyone had any success with this? Here's what happens when I attempt to send a test message:
When set to sandbox and I do a test send to my device, I get a failed outcome of "The Push Notification System rejected the request because of an invalid credential".
When set to production and I do a test send to my device, I get a failed outcome of "The Token obtained from the Token Provider is invalid"
For production, I think that is because I'm sending to a local app build outside of TestFlight/app store, so it is expecting the "development" or sandbox aps-environment.
Not sure what other troubleshooting I can do.
TIA,
I figured out what was happening for me.
The App Name field in the Azure Portal is critical to how the message gets delivered. Even though an APNs Auth Key can be used across multiple apps, the notification still must set the topic to be for that particular app. It seems like Azure Notification Hubs take the App Name field and put it into the apns-topic. Once I had that set to my app identifier, it worked as expected.
Also as an FYI, here is the link to the official documentation
https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-http2-token-authentification