You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
I'm getting the following error after trying to implement js-client-oauth2 in my express app. In my callback function, I'm copying the authorization code grant flow , calling:
ouraAuth.code.getToken(req.originalUrl)
.then(function (user) {
console.log(user) //=> { accessToken: '...', tokenType: 'bearer', ... }
// Refresh the current users access token.
user.refresh().then(function (updatedUser) {
console.log(updatedUser !== user) //=> true
console.log(updatedUser.accessToken)
}).catch((error) => {
console.log(error,'Promise error on user refresh');
});
// Sign API requests on behalf of the current user.
user.sign({
method: 'get',
url: 'http://example.com'
})
// We should store the token into a database.
return res.send(user.accessToken)
}).catch((error) => {
console.log(error,'Promise error on code.getToken');
});
Although req.OriginalUrl is valid, and I set up my ouraAuth according to the protocol, I am catching the following error on my outer code.getToken request:
"TypeError: Body is destroyed
at getRawBody (/Users/oliviazhang/iw-app/my_app/node_modules/servie/dist/common.js:30:15)
at Object.useRawBody (/Users/oliviazhang/iw-app/my_app/node_modules/servie/dist/common.js:15:21)
at HttpResponse.text (/Users/oliviazhang/iw-app/my_app/node_modules/servie/dist/node.js:79:34)
at /Users/oliviazhang/iw-app/my_app/node_modules/client-oauth2/src/request/index.js:18:16
at process._tickCallback (internal/process/next_tick.js:68:7) 'Promise error'
Any help or insight is appreciated - thank you so much!
The text was updated successfully, but these errors were encountered:
"version": "4.3.3"
I was getting this error and fixed it by updating client config in OAuth2.0 Provider
Might be remotely related to yours.
{ error: 'invalid_client', error_description: 'Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The OAuth 2.0 Client supports client authentication method \'client_secret_post\', but method \'client_secret_basic\' was requested. You must configure the OAuth 2.0 client\'s \'token_endpoint_auth_method\' value to accept \'client_secret_basic\'.' }, code: 'EAUTH' }
Update this field: token_endpoint_auth_method": "client_secret_basic"
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm getting the following error after trying to implement js-client-oauth2 in my express app. In my callback function, I'm copying the authorization code grant flow , calling:
Although req.OriginalUrl is valid, and I set up my ouraAuth according to the protocol, I am catching the following error on my outer code.getToken request:
Any help or insight is appreciated - thank you so much!
The text was updated successfully, but these errors were encountered: