Skype Bot OAuth error that wasn't happening before - oauth

I previously had a Skype bot able to post messages using the API.
But on 11/17/17 I started getting this error on every attempt, and as a result, no message gets posted. I haven't changed anything.
requests.exceptions.HTTPError: 401 Client Error: The provided 'OAuth' ticket failed authentication. for url: https://apis.skype.com/v2/conversations/[conversation]/activities/
The process I use is to get an access token witha post to https://login.microsoftonline.com/common/oauth2/v2.0/token
and then to use that token to post a message to https://apis.skype.com/v2/conversations/[conversation]/activities/
It's able to get the token fine, but then when the message post is called, it raises the above exception.

I've faced with exactly the same problem and this worked for me:
I left all send messages endpoint as is for v2, BUT in token generation POST payload I've changed 'scope' -> 'https://api.botframework.com/.default'

Related

Unable to get refresh token in asp.net web api project, using microsoft graph api

I develop an app that should run on server, when the app is loading its being automatically signing in and works fine.
however after an hour when the token is expired i can't use the app again,
it works via http get, and so i get a error response token expired.
I need to add to the Get function condition that checked if token is expired if so to request for refresh token,
however when im trying to do so i get the error
AADSTS9002313: Invalid request. Request is malformed or invalid
i tried to reproduce it via postman and the same error occur, can you guys please tell me what i am doing wrong?
post https://login.microsoftonline.com/common/oauth2/v2.0/token
client_id : value
client_secret: value
grant_type : refresh_token
refresh_token: the current access token i saved when app was initiated
*i also have resource but when i add it i get an error that it is not supported so i deleted it.
thanks.
I was able to resolve it by checking manually the expired flag and if expired to create new connection to the request.

Mautic API 403 error

SO when I try to get a refresh Token from Mautic I am getting an auth code but then from there I am not able to get an access/refresh token. When I try to get it I just receive a 403 error message with invalid code as the description. Not sure what is going on!
Thanks
Cam

Coinbase iOS client getting Error 403 on send_money

When i am sending BitCoins using the send:to:withNotes:withHandler: method , the failure block gets invoked with error localised description mentioning error 403 forbidden.
A 403 response from the Coinbase API usually means your API key or OAuth token is lacking the required scopes for the specific request you are making.
Based on the name of the method, it sounds like it would be the Send Money request, which requires the wallet:transactions:send scope/permission.
You can check with permissions you have for an API key, or OAuth token using the Show Authorization Info request.

Using the same OAuth token for multiple Twitter requests

I am working on an app that uses the same OAuth token and OAuth token secret for multiple requests to post a tweet on behalf of a user. On the first request, the tweet is successfully posted. However on subsequent requests I get an HTTP Error 403: Forbidden. Could this be caused by reusing the OAuth tokens? I am also tweeting the same message on each request.
There are two components of a Twitter error response, the HTTP status code (in this case 403) and an error code that provides more detail on the cause of the failure. Which error code are you seeing in the JSON response? It's possible that the error is regarding duplicate tweets.
Twitter REST API error codes

Google API - request for token from Oauth2 returns “invalid_request” with HTTP code 400

I know same question has been asked many times but even after following each and every post as well trying various suggestions, I am still facing invalid_request error.
I am able to get code successfully from Google API and when I am trying to access accessToken , I am getting this error and HTTP code being sent from Google API is 400.
I have already tried and compared my data with oauthplayground and seems everything is same
Following data is being sent from my Application to Google API
https://accounts.google.com/o/oauth2/auth?
scope=openid+profile+email
&response_type=code
&redirect_uri=http%3A%2F%2Fsavealifetoday.org%2Fblood_donors%2FoAuthCallBackAction%3Fservice_provider_name%3D
&approval_prompt=force
&client_id=193214746340-ea0nq5alpst82n2fno13s9j21pn4f4pf.apps.googleusercontent.com
Access Token URL
https://accounts.google.com/o/oauth2/token?
scope=openid+profile+email
&client_secret=***********
&grant_type=authorization_code
&redirect_uri=http%3A%2F%2Fsavealifetoday.org%2Fblood_donors%2FoAuthCallBackAction%3Fservice_provider_name%3D
&code=4%2F8veoAnihzkao58oWvZaRShn5nhYg.0to7Or-lHPwRXE-sT2ZLcbTblHXFhgI
&client_id=193214746340-ea0nq5alpst82n2fno13s9j21pn4f4pf.apps.googleusercontent.com
But When Application is trying to fetch data over the network, I am getting exception
SEVERE: Error while fetching access token for Google..
OAuthProblemException{error='invalid_request', description='null', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
I am using URLConnectionClient to establish network connection
Go through the OAuth flow using the OAuth playground https://developers.google.com/oauthplayground/.
Then compare what is being sent with your own.
Note that it needs to be an HTTP POST. The code you posted looks like a GET.
Also, your redirect URL looks a little odd. Is that exactly the same URL that you registered in the API console? This is isn't your current error, but will probably become your next one ;-)
It seems that you forgot to send 'state' parameter here (it is mandatory!):
https://accounts.google.com/o/oauth2/auth?
scope=openid+profile+email
&response_type=code
&redirect_uri=http%3A%2F%2Fsavealifetoday.org%2Fblood_donors%2FoAuthCallBackAction%3Fservice_provider_name%3D
&approval_prompt=force
&client_id=193214746340-ea0nq5alpst82n2fno13s9j21pn4f4pf.apps.googleusercontent.com
In Java code you can generate it in a way like this:
String state = new BigInteger(130, new SecureRandom()).toString(32);
So you request should look like this:
https://accounts.google.com/o/oauth2/auth?
scope=openid+profile+email
&response_type=code
&redirect_uri=http%3A%2F%2Fsavealifetoday.org%2Fblood_donors%2FoAuthCallBackAction%3Fservice_provider_name%3D
&approval_prompt=force
&client_id=193214746340-ea0nq5alpst82n2fno13s9j21pn4f4pf.apps.googleusercontent.com
&state= {insert_here_generated_state}
And also I don't know if it is necessary to send a 'scope' parameter in "Access Token URL".

Resources