Reputation: 1301
Having a doubt in case of Oauth being used more for authentication.
Few questions
I am little bit lost around
Upvotes: 6
Views: 1575
Reputation: 504
Token timeout period is usually configured per-application in authorization server, which will then be applied to all requests accessing that particular application.
If the authorization server is capable to determine the level of trust of the client, e.g. the client is a managed device, the authorization server may issue tokens with a longer/shorter timeout period according to the client settings. An example can be found from Azure AD Conditional Access.
There are two ways to determine the validity of the access token.
Using a self-encoded access token, e.g. JWT. In this case the application server can validate the integrity of the access token without negotiating with authorization server directly.
Some authorization server implements Token Introspection endpoint for application server to check the validity of the access token. But not all authorization servers provide this feature.
I believe so, but sorry that I cannot find real world reference on that. Notice that even Azure AD does not provide a token introspection endpoint, so a considerable portion of OAuth2 applications should using self-encoded access token, which does mitigate this scalability issue.
That's why the lifetime of access tokens should be kept short, and the client should refresh the access token from authorization server regularly to maintain access authorization.
Upvotes: 1