Skip to content
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

SSO Timeout Configuration #3873

Closed
KevinThompsonYCRX opened this issue Aug 26, 2020 · 12 comments · Fixed by #4494
Closed

SSO Timeout Configuration #3873

KevinThompsonYCRX opened this issue Aug 26, 2020 · 12 comments · Fixed by #4494
Labels

Comments

@KevinThompsonYCRX
Copy link

In the new SSO implementation, it looks like the ID token never has the 'Expiry' field set, and defaults to having a 1 hour timeout. It would be more convenient if this was extended, and most convenient if it could be configured in the workflow controller configmap.

The cookie containing this token has a 10 hour timeout. It seems like it would make the most sense for this timeout to match the token Expiry.
https://github.com/argoproj/argo/blob/d07a0e74888254fe78fa653e532c5f1963056598/server/auth/sso/sso.go#L185-L192

This is where I believe the token Expiry value would need to be set:
https://github.com/argoproj/argo/blob/d07a0e74888254fe78fa653e532c5f1963056598/server/auth/sso/sso.go#L153-L165

Related documentation:
https://godoc.org/golang.org/x/oauth2#Token

@alexec
Copy link
Contributor

alexec commented Aug 26, 2020

The 10 hour limit is intended to be a working day. Would you like to raise a PR?

@KevinThompsonYCRX
Copy link
Author

I haven't worked with golang before but I'll give it a try

@boniek83
Copy link

boniek83 commented Sep 8, 2020

I'm under impression that the default is a lot lower than 1h. It is like 1 minute at most. It is infuriating to work like this :D

@KevinThompsonYCRX
Copy link
Author

After doing some more research, it looks like the id_token timeout is determined by the oauth2 provider. For Azure, this is fixed at 3599 seconds (https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow).

It seems like implementing a token_refresh is a more appropriate way to address this issue for me. @boniek83 what oauth provider are you using?

@boniek83
Copy link

boniek83 commented Sep 8, 2020

@boniek83 what oauth provider are you using?

On premises gitlab.

@KevinThompsonYCRX
Copy link
Author

I wrote up some rough changes to try and refreshing tokens, but it's not possible since oidc won't refresh id_tokens. This newer PR switches to using access tokens, which can be refreshed to extend SSO logins further: #4035. If refreshes get added into that PR, then this issue can be closed.

@alexec alexec linked a pull request Sep 18, 2020 that will close this issue
6 tasks
@alexec
Copy link
Contributor

alexec commented Sep 18, 2020

The timeout is currently the expiry of the id_token. This varies by provider, but is typically around 5m. This is not what anyone wants. We need to do more work to make this easier.

@alexec
Copy link
Contributor

alexec commented Sep 30, 2020

Once #4095 is merged, it'll be easy to add timeout. Would anyone like to submit a PR?

@arghya88
Copy link
Contributor

arghya88 commented Nov 3, 2020

@alexec so setting a timeout using an environment variable would be a reasonable approach?

@alexec
Copy link
Contributor

alexec commented Nov 3, 2020

I think this might be a commonly used feature. Maybe sso.timeout config item?

@arghya88
Copy link
Contributor

arghya88 commented Nov 3, 2020

I think this might be a commonly used feature. Maybe sso.timeout config item?

You mean set it in the cm https://github.com/argoproj/argo/blob/c71116ddedafde0f2931fbd489b9b17b8bd81e65/docs/workflow-controller-configmap.yaml and use that in code. Is there any other sso config that we can set now via cm? Nevertheless I can give this a try

@alexec
Copy link
Contributor

alexec commented Nov 3, 2020

yes - all SSO config is in the cm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants