Skip to content

Bearer token refresh after HTTP 401 and/or 30 minutes #2023

Answered by tomchristie
Jaharmi asked this question in Q&A
Discussion options

You must be logged in to vote

A custom authentication class is probably what you want here.

I would do something like the example here - store the bearer token as state on the auth class. Any time you get a 401, attempt to refresh the bearer token.

Is that enough info to get you started on this? It'd be fab if you could share how you progress on it - no doubt it'll end up being useful to someone else further down the line.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tomchristie
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants