I got the authorization code from
https://home.nest.com/login/oauth2?client_id=CLIENT_ID&state=FOO.
I want to get the access_token, but something wrong!
https://api.home.nest.com/oauth2/access_token?code=AUTHORIZATION_CODE&client_id=STRING&client_secret=STRING&grant_type=authorization_code
Result:
url: "/oauth2/access_token?code=xxx&client_id=xxx&client_secret=xxx&grant_type=authorization_code",
message: "404 Not Found"
You need to POST your request. Also, the authorization code expires when used once, so you may need to get another.
Related
When I try to POST to SharePoint REST API to the url/_web/contextinfo with POSTMAN I get status code of 200 and a new X-RequestDigest
But when I do the same in code bellow, I get status code of 403.
I think I'm missing something that is making a secure http request to sharepoint.
Thank you for your further help.
Image
I am attempting to use postman with imgur api I used the 'open with postman' button at the top of the documentation page and tried to obtain a token with the default populated settings for callback authorization and token url's and I get a popup window with:
{"data":{"error":"redirect_uri_mismatch","request":"/oauth2/authorize","method":"GET"},"success":false,"status":400}
I am hoping this is a simple thing as i am pretty new to api's.
`Further info:
callback url: https://www.getpostman.com/oauth2/callback,
auth url: https://api.imgur.com/oauth2/authorize,
Access Token url: https://api.imgur.com/oauth2/token,
no Scope,
no State ,
Client authentication: send as basic header
`
I've got the same problem but I fixed it.
See if your callback URL in Postman is the same as your Redirect in Imgur (You can always edit it in Imgur) https://imgur.com/account/settings/apps.
Also, make sure that there is no comma at the end in the callback URL in Postman (That was my mistake). Everything else looks fine but just in case I'll show you what I have.
Postman:
Get -> https://api.imgur.com/3/account/me/images
Callback URL: https://www.getpostman.com/oauth2/callback
Auth URL: https://api.imgur.com/oauth2/authorize
Access Token URL: https://api.imgur.com/oauth2/token
Scope, State: Empty
Client Authentication: Send as Basic Auth header
I am trying to get new access tokens before they expire using reconnect api endpoint, but the api call to https://appcenter.intuit.com/api/v1/Connection/Reconnect is being redirected to https://quickbooks.intuit.com/learn-support/en-us/do-more-with-quickbooks/third-party-app-security-requirements-updating-soon/01/428295, rather the expected response. Am i missing something here? Appreciate the help.
According to Intuit's documentation, you're using the wrong URL:
https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0#refresh-the-token
Did you try using the correct URL?
From the docs:
To refresh an access token, your application sends an HTTPS POST request to
Intuit’s authorization server
(https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer)
that includes the following parameters:
I am trying to send an auth header along with an axios POST request from inside a Vue application. I currently am getting a 401 from my back end with an auth header that works when I do a curl.
I've tried splitting it up into variables and putting it in but that did not work and resulted in the same error (401).
This is just the axios code I am trying to get to work. I have checked with console.log and all values I am trying to send exist, though I don't know how to check the axios headers before sending.
axios.defaults.headers.common["Authorization"] = JWTtoken;
axios.post(updateURL, {
token: result.token
});
The backend code can't be changed easily for testing so need to figure out why not sending from the front end
I'd like it to send the correct header along with my request so I don't get a 401 status code.
I think you need this..
axios.defaults.headers.common["Authorization"] = "Bearer " + JWTtoken;
axios.post(updateURL, {
token: result.token
});
Notice that I add Bearer in the Authorization. It is how JWT was meant to be used according to their introduction.
However, if the answer is wrong. Help us by providing more information about your response in Developer Console as #RuChernChong suggest. Any error logs would be helpful as well.
Another way by using Axios globals to set for example X-Auth-Token encoding from JWT.io directly like this:
axios.defaults.headers.common["X-Auth-Token"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
I'm having trouble getting the tokens back from Reddit's Oauth. I'm running a node.js backend with a React front end. What I get back from Reddit when I try to exchange the code for a bearer token using node-fetch, all I get is just a this below:
"url": "https://www.reddit.com/api/v1/access_token",
"status": 200,
"statusText": "OK",
...
There's more there but there's no field in the body or anywhere else that holds the access token or refresh token.
Could someone help me out? Thanks!
that appears to be a deprecated endpoint, i dont see anywhere on https://www.reddit.com/dev/api
try using passport: https://github.com/slotos/passport-reddit. it will work.