Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to avoid decoding the JWT token in geTtimestampFromToken? #80

Open
mrhighstone opened this issue Feb 12, 2025 · 0 comments
Open

Comments

@mrhighstone
Copy link

I love the simplicity of this solution and implemented it in a VueJS/TypeScript application connecting to a .NET Core 8 WebAPI using the recently released ASP.NET Core Identity Web API.

So far so good, but unfortunately I receive the following exception when the authTokenInterceptor is trying to refresh te tokens.

Error: Unable to refresh access token for request due to token refresh error: Invalid token specified: e2 is undefined

Eventually I nailed this down to the method getTimestampFromToken where jwtDecode<JwtPayload>(token) fails to decode the JWT token.

Now it appears that the implementation of ASP.NET Core Identity Web API does not use JWT tokens but uses custom tokens instead. So obviously, the token cannot be deconstructed.

Is there a way/trick/possibility to not fail on this method and still refresh the token - other than implementing JWT tokens in the backend - and still being able to use this awesome solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant