Getting invalid_grant error when using django oauth provider - django

I am using django oauth provider and curl like in the example on the documentation to get an access token but I keep getting an error message. {error: invalid_grant}. How do I fix it? I would like to get this running for Android.

Related

Getting 401 token error with Azure Active Directory SSO

I'm trying to setup Azure AD SSO to authorise users to log into AWS. I believe I have things mostly set up, I get the Microsoft login option & after logging in I get the error Invalid request 401 - error getting token.
I've tried everything I can find that might be wrong but to no avail, does anyone have any clue as to what might be misconfigured?

Unable to fetch list of Azure Resources via Postman

I am trying to fetch the list of resources present in my Azure Resource Group.
To do that, I got an access token by registering one app in Azure AD using the client_credentials flow.
But when I am using that token to query like below, I'm getting 401 Unauthorized - Authentication failed error.
Query that I used:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources?api-version=2021-04-01
I have owner access to all my resources but why am I getting 401 Unauthorized error. Is there any step that I missed?
Can anyone point me in a right path?
I came to know I have to give API permissions for Azure Service Management.
After giving user_impersonation, I changed the scope to https://management.azure.com/.default and got access token.
Using this token, I successfully got the list of resources without any errors.

Getting 403 error when trying to add new tenant

I added a service provider to WSO2IS and use its secret to get an access token, I then use this access token to execute endpoint https://localhost:9443/t/carbon.super/api/server/v1/tenants, but I am getting 403 error. An access token is for the admin user, that as far as I see has all privileges. Why am I getting a forbidden error and how can I fix it?
Follow the steps in https://stackoverflow.com/a/65371473/10055162. If you generated the token without passing the required scopes (In your case internal_list_tenants), you will get 403 Forbidden response from the REST API call. More info (3)

Postman fails to authorize against Slack App

I'm following the steps described in this Slack tutorial on authorizing Postman. When I get to the end and try to request the token from Postman, the Slack OAuth window pops up and I can authorize.
On Postman however, I get an error message:
Could not complete OAuth 2.0 login.
Check Postman Console for more details.
Checking the Postman console shows:
POST https://slack.com/api/oauth.access
bad_client_secret
Error
If checked and double checked, and I'm sure I copied the right client secret value.
Can anyone see what I'm doing wrong? Thanks!

facebook-graph-api Getting "Invalid OAuth access token." after 3 https calls

Hi im trying to get group wall feeds , im using desktop application to get all the feeds but after 3 https api calls im getting :
{"error":{"type":"OAuthException","message":"Invalid OAuth access token."}}
this are my calls:
https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=30&offset=0
https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=60&offset=30
https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=90&offset=60
https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=120&offset=90 <-- this call gives me the error
the weird thing is that when im take this https call the one failed and run it in firefox , it does return me result any idea way ?
You do not have proper authentication set. See: http://developers.facebook.com/docs/authentication/
For my case, I actually did it this way:
I have tried several ways, and I got the invalid OAuth access token error too.
After getting my page access token using the Graph Explorer, I wrote this code:
pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'
mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token"+pagetoken
I then noticed an equal sign was missing, and that fixed my invalid OAuth access token error.
pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'
mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token="+pagetoken
I hope it helps anyone with the same issue.
That happened to me for hours:
facebook-graph-api Getting “Invalid OAuth access token.”
In my case, the application was re-directing to a local address, and the URL authorized by Facebook was not local, so Facebook was not login me in.
The access_token for the user I was using was some old access_token kept in the script by window.sessionStorage. So I thought I was using the right access_token, but I was not.