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

Allow setting more claims from the ID token to the Plug.Conn.t() #7

Closed
tanguilp opened this issue Oct 27, 2021 · 3 comments
Closed

Comments

@tanguilp
Copy link
Owner

Right now there exists a callback called with the tokens after redirect (https://hexdocs.pm/plugoid/Plugoid.RedirectURI.html#module-options).

The initial idea was to use it with the oauth2_token_manager library, but this one is not production ready (and won't as long as there's no good solution for clustered deployments).

Right now only the "sub" and "acr" claims are set in Plugoid's session. As requested by a user on a forum, it would be nice if more claims could be set in the session. 2 possible ways:

  • having the callback return a Plug.Conn.t() so that the user can set anything he wants in the session
  • add an option to choose which additional claims to add to Plugoid's authentication session
brianmay added a commit to brianmay/plugoid that referenced this issue Nov 7, 2021
@brianmay
Copy link

Fix for this is in https://github.com/tanguilp/plugoid/compare/conn_callback.

Works for me. Can this get merged?

@brianmay
Copy link

I am debating whether or not we still need the state cookie. With this change, all required variables can go into the main session. I guess it might be better(?) having the state cookie with SameSite=None, rather then doing this for the main session cookie. But does that actually gain us anything? Still trying to think this through.

@tanguilp
Copy link
Owner Author

This is merged already in v0.5.0. See the CHANGELOG.

The state cookie is used for requests between the app and the OP, and cannot be removed. See https://hexdocs.pm/plugoid/Plugoid.html#module-cookie-configuration

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

Successfully merging a pull request may close this issue.

2 participants