AccessTokenPayload is null
See original GitHub issueAccessTokenPayload is null after successful authentication.
I see that access token and id token are retrieved successfully but accesstokenpayload is null.
I noticed extractAccessTokenPayload method will return null if token contains 2 dots. Valid JWT tokens actually must contain 2 dots in order to be valid header.body.signature. Is this a bug or intentional?
const extractAccessTokenPayload = tokens => {
if(tokens.accessTokenPayload)
{
return tokens.accessTokenPayload;
}
const accessToken = tokens.accessToken;
try{
if (!accessToken || countLetter(accessToken,'.') === 2) {
return null;
}
return JSON.parse(atob(accessToken.split('.')[1]));
} catch (e) {
console.warn(e);
}
return null;
};
Also useOidcUser() hook says that user is not authenticated. Is this because of the same issue?
Version I am using is 5.4.2
Thank you
Issue Analytics
- State:
- Created a year ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Empty payload in access_token - Auth0 Community
I created a new Application and API while following Auth0 tutorials and tokens requested from my Angular web application come with no payload...
Read more >TypeError: Cannot read property 'payload' of null #15 - GitHub
Looking for some help here - I have a simple Node/Express app which is validating a token: exports.validate = function(req, res) {
Read more >my function return null when I initiate value correctly(node.js ...
What I was trying to is 'pass different token passport's jwtstrategy depends on the situation. So, If the refresh token and the access...
Read more >How to get an access token with JWT Grant
This topic demonstrates how to generate an access token manually using JSON Web Token (JWT) Grant authentication. Note: Instead of generating the access...
Read more >Payload (java-jwt 3.4.1 API) - javadoc.io
The Payload class represents the 2nd part of the JWT, where the Payload value is hold. ... Get the value of the "aud"...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I understood, it shoulb be countLetter(accessToken,‘.’) != 2 instead of countLetter(accessToken,‘.’) === 2
I will make a pr from my phone :p
Thank you for the feedback. I close the pullrequest.