HTTP 400 error after some calls using phone number from Twillio - phone-call

While using a phone number from Twillio to call our customers, sometime suddenly it shows this error :
Bot Error ❌: HTTP 400 error: Unable to create record: Account not authorized to call +966552662***. Perhaps you need to enable some international permissions: https://www.twilio.com/console/voice/calls/geo-permissions/low-risk
I opened the link to check the geo-permissions of the Twillio phone number that I bought, it shows this result :

Related

"oauth2: cannot fetch token: 401 Unauthorized" happens sometime in Google Workspace Directory API

I created the code which get the member's information by Google Workspace Directory API. This code is executed everyday, and sometime I fece the error which is "oauth2: cannot fetch token: 401 Unauthorized".
Bad thing is that this error is happend only 1-2 times per month, and I cannnot reproduce by myself. I mean, if I re-execute the code after facing this error, it works well.
I paste full error message below:
"failed to get the members by email, email ="***#***": Get "https://admin.googleapis.com/admin/directory/v1/groups/***": oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error": "unauthorized_client",
"error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."
}"
API is executed by using Service Account which has appropriate roles below:
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/admin.directory.group.member.readonly
https://www.googleapis.com/auth/admin.directory.group.readonly
Is it only better solution to use exponential back off?
Thank you in advance.

Issue in redirecting back to our Site from sandbox test authorize net

After processing the payment, control is not directing back to our site(x_relay_url) from https://test.authorize.net/gateway/transact.dll.
The URL mentioned in the x_relay_url cannot be accessed directly it requires session id and other details to access it which was passed to Authorize net page using merchantDefinedData variables.
I checked the following article also but our URL seems to be fine and we checked our code there is nothing wrong in that.
I tried multiple URLs in "x_relay_url" but nothing seems to be working.
Any help is appreciated.
Error Message:
An error occurred while trying to report this transaction to the
merchant. An e-mail has been sent to the merchant informing them of
the error. The following is the result of the attempt to charge your
credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.

"Provided Authorization Grant is invalid" when using refresh_token WSO2 IS 5.2.0

I recently updated my environment from WSO2 IS 5.0.0 to WSO2 IS 5.2.0. My environment consists of one machine deployed on EC2 AWS instance. I am using MySQL(not the default H2 database). The machine on which the IS is deployed is Windows Server 2012 R2.
I am using the password grant type in order to get access token for particular user and also store the refresh token so that I am able to issue another access token when needed. I am doing the following request in order to get access token:
POST
https://(IS-URL)/oauth2/token?scope=openif&grant_type=password&username=test#abv.bg#localhost.io&password=Asd123##
Configure the appropriate Authorization Basic header
After that I am using the refresh token in order to issue new access tokens. For example:
POST
https://(IS-URL)/oauth2/token?scope=openid&grant_type=refresh_token&refresh_token=
Configure the appropriate Authorization Basic header
After I execute the latest POST call from Postman several times in 2-5 sec interval, after the first 5-7 calls, I start to receive the following error response:
{
"error": "invalid_grant",
"error_description": "Provided Authorization Grant is invalid"
}
I am expecting to receive the new access token and instead I am receiving the mentioned above error. Then I modifiedthe log4j.properties by updating the following lines:
log4j.logger.org.wso2.carbon.identity=DEBUG
log4j.logger.org.wso2.carbon.identity.application=DEBUG
log4j.logger.org.wso2.carbon.identity.mgt=DEBUG
log4j.logger.org.wso2.carbon.identity.oauth2=DEBUG
log4j.logger.org.wso2.carbon.identity.provisioning=DEBUG
log4j.logger.org.wso2.carbon.identity.user.account.association=DEBUG
log4j.logger.org.wso2.carbon.identity.user.profile.mgt=DEBUG
Then I started the IS and tried again the mentioned above scenario and this is what I received in the log file:
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Access Token request received for Client ID GCFfyPSGkykWG4zQTKoDp8NEvjIa, User ID null, Scope : [openid] and Grant Type : refresh_token
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.token.handlers.clientauth.AbstractClientAuthHandler} - Can authenticate with client ID and Secret. Client ID: GCFfyPSGkykWG4zQTKoDp8NEvjIa
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.token.handlers.clientauth.AbstractClientAuthHandler} - Grant type : refresh_token Strict client validation set to : null
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Client credentials were available in the cache for client id : GCFfyPSGkykWG4zQTKoDp8NEvjIa
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Successfully authenticated the client with client id : GCFfyPSGkykWG4zQTKoDp8NEvjIa
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.token.handlers.grant.RefreshGrantHandler} - Access Token is not in 'ACTIVE' or 'EXPIRED' state for Client with Client Id : GCFfyPSGkykWG4zQTKoDp8NEvjIa
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.token.AccessTokenIssuer} - Invalid Grant provided by the client Id: GCFfyPSGkykWG4zQTKoDp8NEvjIa
[2016-11-15 21:29:18,873] DEBUG {org.wso2.carbon.identity.oauth2.token.AccessTokenIssuer} - OAuth-Error-Code=invalid_grant client-id=GCFfyPSGkykWG4zQTKoDp8NEvjIa grant-type=refresh_token scope=openid
For more information, please take a look at the whole log file:
https://www.dropbox.com/s/ygfc9hrrgxjkzkh/console.log?dl=0
Has someone experienced similar issue and could this be bug in the IS or it is caused by some sort of misconfiguration?
I took a look at Refresh token returns invalid grant type but was not able to find direct answer to the question.
Just want to mention that I tried issuing one request per second and tried this for 5 min interval and was not able to reproduce the issue. It seems it happens when the request frequency is high enough.
Thanks in advance.
As per this code and your logs, the access token is neither in 'ACTIVE' nor 'EXPIRED' state. You can look for that particular token in IDN_OAUTH2_ACCESS_TOKEN table. That will give you a hint about what has gone wrong.
Update:
I analyzed your dataset. The problem is that since you have sent the same token request several times, there are many entries in this tables with TOKEN_STATE=INACTIVE. And also you have 2 entries with the same timestamp (i.e. 2016-11-17 11:40:02) in TIME_CREATED column, which has happened to be the latest among all. So when IS tries to pick the latest token (which ideally should be the ACTIVE one) db server returns 2 tokens. But IS has to pick just one. It can be any of those 2 since the timestamp is the same. So when it picks the INACTIVE one, you should see above error.
Ideally, IS should have handled this properly. But as a solution for you, if you do not keep sending the same request very frequently, you should be able to get rid of the error. Just send a request and wait till the response comes. If it takes a lot of time, that's a different issue to analyze and solve.

Facebook API - Page country restriction Set to specific country getting error - Unsupported get request

My Facebook Page country restriction Set to specific country.
so , when I am using application access token with following API to download json for above pageid -
https://graph.facebook.com/PageId?access_token=xxxxx&method=GET&metadata=true&format=json
getting following error : -
{"error":{"message":"Unsupported get request.","type":"GraphMethodException","code":100}}.
Please any one have any idea how we can solve this issue ?

using graph API trying to get statuses

I am trying to get user status updates using the graph API.
These are my steps
The user grants me user_status,read_stream permission
then my app does the following.
https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=".$FBappID."&client_secret=".$FBappSecret
and get the $AccessToken
next i goto https://graph.facebook.com/the-username/permissions?access_token=$AccessToken
i make sure read_stream and user_status = 1
then i try https://graph.facebook.com/the-username/statuses?access_token=$AccessToken
when i do this i get the error " failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request"
First to get the token from facebook, the url must set like
https://graph.facebook.com/oauth/authorize?client_id=[App_id]&redirect_uri=http://[you app uri]/url/where_you_recive_the_token_from facebook
This will redirect something like:
http://you_app_uri/url/?code=[Code Generated By Facebook String(196)]
Then you can used
https://graph.facebook.com/the-username/statuses?access_token=$_GET['code']