Security icon indicating copy to clipboard operation
Security copied to clipboard

Add MaxAge to OpenIdConnectOptions

Open openidauthority opened this issue 9 years ago • 6 comments

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.

openidauthority avatar May 25 '17 00:05 openidauthority

Should this be implemented as a TimeSpan, int, or nullable int?

openidauthority avatar May 25 '17 00:05 openidauthority

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.

Eilon avatar Jun 09 '17 19:06 Eilon

@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.

Eilon avatar Aug 10 '17 22:08 Eilon

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].>

openidauthority avatar Aug 11 '17 05:08 openidauthority

@Eilon - you can assign it to me.

openidauthority avatar Aug 11 '17 05:08 openidauthority

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!

Eilon avatar Aug 11 '17 06:08 Eilon