Add MaxAge to OpenIdConnectOptions
In a single sign-on environment, sometimes a specific application needs to have a shorter session than the identity provider. For example, the identity provider might have a 10 hour session, but a high-security application might need to re-authenticate users after 15 minutes of inactivity. Setting a short expiration cookie on the client application is ineffective, because when the local session expires, the user is automatically logged back in due to the existing session at the identity provider.
The OIDC spec has a max_age parameter that can be sent with an authorization request. If present, and the identity provider has not actively authenticated the user within the length of time specified, the user will be prompted to re-authenticate.
I propose that a MaxAge property be added to the OpenIdConnectOptions, and if the time span is one second or longer, that the max_age parameter would be set for the authenticate request.
I have tested this locally already and can submit a pull request.
Should this be implemented as a TimeSpan, int, or nullable int?
This seems reasonable, we are working to finish the 2.0 release, but we will take a look at it for the 2.1 release (which isn't too much later).
As to the type, a nullable Timespan would be ideal.
@openidauthority - any chance you want to submit a PR for this? We've started work on the 2.1 release and this would be a good feature to have in there.
I'll give it a shot a soon as I have a bit of time.
On Thu, Aug 10, 2017, at 03:42 PM, Eilon Lipton wrote:
@openidauthority[1] - any chance you want to submit a PR for this? We've started work on the 2.1 release and this would be a good feature to have in there.> — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub[2], or mute the thread[3].>
@Eilon - you can assign it to me.
Hmm that must be a new feature - I don't recall GitHub allowing assigning an issue to someone not in the org! Or maybe I never noticed it before.
@openidauthority thanks for taking a crack at this!