-
Notifications
You must be signed in to change notification settings - Fork 334
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
OAuth expiration times interfere with cookie auth expiration #229
Comments
So that is a bug, but I'd also like to bring up a feature request at the same time if possible: Allow dynamic token expirations. We've been considering implementing client-specific token expirations. With the current configuration we have to specify |
This may be a problem with other modules as well. We see some cases where we set
|
@collinsauve Were you able to find a workaround for this issue? I'm not sure what scenario is broken BTW, so if you don't already have a solution, could you expand your description of the issue? |
Issue
This concisely captures the issue:
To expand on that explanation, the issue is that when using both IAppBuilder.UseCookieAuthentication and either IAppBuilder.UseOAuthAuthorizationServer or IAppBuilder.UseTwoFactorSignInCookie, the AccessTokenExpireTimeSpan, AuthorizationCodeExpireTimeSpan, or timespan specified in UseTwoFactorSignInCookie can end up overriding the expiration time of the ApplicationCookie (.AspNet.ApplicationCookie) instead of it using CookieAuthenticationOptions.ExpireTimeSpan. As an example, setup
Then when these conditions are all met:
The response to the authorize endpoint will include:
That Workaround
My workaround is pretty hacky: I reset
This gives me a correct |
I still don't have a work-around for |
If the authorization server's authorization uri is hit at the same time the session is regenerated, then the value provided to OAuthAuthorizationServerOptions.AccessTokenExpireTimeSpan is used to set the expiry for the
.AspNet.ApplicationCookie
instead of CookieAuthenticationOptions.ExpireTimeSpan.For example:
OAuthAuthorizationServerOptions.AccessTokenExpireTimeSpan
is set to 5 minutesCookieAuthenticationOptions.ExpireTimeSpan
is set to 60 days.https://login.nudge.ai/oauth/authorize
In our app we were getting this:
The text was updated successfully, but these errors were encountered: