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: redirect to OIDC providers only once in registration flows #4064

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

David-Wobrock
Copy link
Contributor

@David-Wobrock David-Wobrock commented Aug 28, 2024

When doing a social sign-in, but some required identity fields are not provided by the social provider, Kratos switches to a registration flow in order to fill the missing data.

As #2863 describes it, the idea is that instead of redirecting back to the social provider when submitting the registration form, we handle the registration directly by Kratos and the previously stored OIDC data.

The main rationale is that it feels very unusual for users to select twice your Google account (for instance) during social sign-in. Or even more if more errors occur on the registration form.

Three steps fix this issue:

  1. Store OIDC data when processing the registration: provider ID, tokens and claims are stored
  2. When submitting an OIDC registration form, when OIDC data is stored, do not redirect to the provider, but instead load this data to process the registration. ⚠️ This has the side-effect that API calls (in e2e tests for instance) that previously were redirected to the social provider and became browser calls, now remain API calls.
  3. When completed, delete the OIDC data from .

Related issue(s)

Fixes #2863

Core code based on #3416

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
    [email protected]) 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

@David-Wobrock David-Wobrock force-pushed the feat/oidc-registration-single-redirect branch 2 times, most recently from fb74bf8 to 350b1db Compare August 29, 2024 15:14
@David-Wobrock David-Wobrock force-pushed the feat/oidc-registration-single-redirect branch 3 times, most recently from 2a5c310 to 04d1348 Compare September 13, 2024 15:03
@David-Wobrock David-Wobrock force-pushed the feat/oidc-registration-single-redirect branch 2 times, most recently from ac66d6b to 296907b Compare November 11, 2024 15:03
@David-Wobrock David-Wobrock force-pushed the feat/oidc-registration-single-redirect branch 6 times, most recently from b8fd734 to 09433f9 Compare December 28, 2024 16:23
test(e2e): ensure there is only one OIDC redirect

Co-authored-by: Jakub Fijałkowski <[email protected]>
@David-Wobrock David-Wobrock force-pushed the feat/oidc-registration-single-redirect branch from 09433f9 to 2ca9f28 Compare December 28, 2024 17:15
@David-Wobrock David-Wobrock marked this pull request as ready for review December 28, 2024 18:06
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.

Kratos redirects twice to OIDC provider when missing traits
2 participants