Skip to content

Short max_age can trigger re-auth, but also results in short lived token. How do we get tokens for longer time? #598

Answered by rayluo
raqsilva asked this question in Q&A
Discussion options

You must be logged in to vote

Out of curiosity, where are the code samples that use max_age?

There is no official sample for max_age. It is just an optional parameter that can be added into any existing sample which uses either initiate_auth_code_flow() (i.e. web app) or acquire_token_interactive() (i.e. desktop app).

I understand how it seems odd, but that was a way for us to force re-auth when the user has logged out of our app.

We do not have accounts or cache anymore in that stage, that is why we need to get a new one by acquire_token_by_auth_code_flow. Basically the user has logged out of the app but not Microsoft.

It is not odd for an app to sign out user. But that shouldn't prevent you from utilizing token …

Replies: 6 comments

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
Comment options

You must be logged in to vote
0 replies
Answer selected by rayluo
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
2 participants
Converted from issue

This discussion was converted from issue #444 on September 22, 2023 18:59.