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

feat: pass OIDC claims into post-login flow to include in web hook context #3922

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fenech
Copy link
Contributor

@fenech fenech commented May 14, 2024

The login flow doesn't trigger a refresh of the identity when the OIDC claims have changed. By passing the claims through to the web hook context, this means that an external handler can be configured to update the identity as appropriate, when there are changes.

Related issue(s)

#2898

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

The PR looks a lot bigger due to the fact that the Claims type has been moved into its own separate package, to resolve a circular dependency. I suspect that it is not in the right place and should be moved elsewhere.

The linked issue refers to refreshing the identity directly as part of the login flow, to handle the case where the OIDC Claims have changed.

However, my follow-up proposal is different: if instead of directly updating the identity, we just pass the OIDC Claims through to the web hook context, we allow users to write their own web hook handler to update the identity as they would like. I think it's a much less invasive change to Kratos (just passing an extra object through the login/post-login flow).

@fenech fenech changed the title Pass OIDC claims into post-login flow to include in web hook context feat: Pass OIDC claims into post-login flow to include in web hook context May 14, 2024
@fenech fenech changed the title feat: Pass OIDC claims into post-login flow to include in web hook context feat: pass OIDC claims into post-login flow to include in web hook context May 14, 2024
@fenech fenech force-pushed the feature/oidc-claims-web-hook-context branch from 9f37d04 to 4b99a8c Compare May 23, 2024 11:14
The login flow doesn't trigger a refresh of the identity when the OIDC
claims have changed. By passing the claims through to the web hook
context, this means that an external handler can be configured to
update the identity as appropriate, when there are changes.
@fenech fenech force-pushed the feature/oidc-claims-web-hook-context branch from 4b99a8c to 80bdfb0 Compare June 4, 2024 13:14
@fenech
Copy link
Contributor Author

fenech commented Jun 4, 2024

I'm periodically coming back to check the status of this PR and clicking "update" to rebase it, but I don't know if you'd prefer for me to just leave it as it is 😄

I'm happy to contribute to some docs as well, just wanted to make sure the approach was good before starting to do that.

@kghost
Copy link

kghost commented Jun 6, 2024

Yes, this is crutial, otherwise we can't keep SSO information up to date.

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 this pull request may close these issues.

None yet

2 participants