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

OIDC - maybe allow id token for authentication #3590

Closed
tomas-langer opened this issue Oct 27, 2021 · 3 comments · Fixed by #8153
Closed

OIDC - maybe allow id token for authentication #3590

tomas-langer opened this issue Oct 27, 2021 · 3 comments · Fixed by #8153
Assignees
Labels
4.x Version 4.x enhancement New feature or request P2 security
Milestone

Comments

@tomas-langer
Copy link
Member

Similar to what was proposed in #3457

This requires some analysis whether such usage is the right way to go.

@tomas-langer tomas-langer added enhancement New feature or request security labels Oct 27, 2021
@tomas-langer tomas-langer changed the title OIDC see if we could use id token for authentication OIDC - maybe allow id token for authentication Oct 27, 2021
@jmntn2000
Copy link
Contributor

The one issue is the expire time is usually longer on the ID token then the access token. Access tokens usually have a short lifespan so that applications have to check in with IDP to make sure session is still valid. If the ID token had a longer time to live set then application may incorrectly assume user is still logged in.

I do think we need to take your recent changes with putting ID token in the cookie and utilize that to build the principal since it usually has more attributes about the user then the access token.

@m0mus m0mus added the P3 label Nov 8, 2021
@jmntn2000
Copy link
Contributor

jmntn2000 commented Nov 12, 2021

See pull request #3637

Tried to build off of the updates from @tomas-langer and add the following functionality to OIDC:

  1. Added server side refresh. If you are using cookies and server side OIDC provider you run into issues when the access token expires. All javascript related calls from the client will fail due to expired token and js calls for SPA will not redirect to lean on OIDC Provider for new tokens. To solve this I saved the refresh token encrypted in a separate cookie and when access token used for the request is expired I refresh it and update cookies so there is no disruption to the client (assuming refresh token is still valid).

  2. Change the build subject to utilize the id token for principal if available.

  3. Added the logout-uri option to the config

  4. Added a force https option to config for building redirect URIs. This is helpful if you are behind an https load balancer and helidon itself is serving http causing the get schema or issecure methods to return http. This option will force all url builds to use https even if helidon itself served http on the received request.

@jmntn2000
Copy link
Contributor

@tomas-langer Could you please review these OIDC changes so we can look at getting them merged? Let me know if you see anything you want changed or added and I can get it done. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x enhancement New feature or request P2 security
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants