Skip to content

Commit 4f8b28b

Browse files
committed
Refactor OIDC login redirection handling
- Prevent redirecting the last step in the OIDC flow involving the state parameter, ensuring it remains part of the core OIDC process. - This ensures secure and consistent handling of redirects in the OIDC login flow.
1 parent 5b35a07 commit 4f8b28b

File tree

1 file changed

+3
-0
lines changed
  • coderd/coderdtest/oidctest

1 file changed

+3
-0
lines changed

coderd/coderdtest/oidctest/idp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ func (f *FakeIDP) LoginWithClient(t testing.TB, client *codersdk.Client, idToken
496496
f.stateToIDTokenClaims.Store(state, idTokenClaims)
497497
return nil
498498
}
499+
// This is mainly intended to prevent the _last_ redirect
500+
// The one involving the state param is a core part of the
501+
// OIDC flow and shouldn't be redirected.
499502
if redirectFn != nil {
500503
return redirectFn(req, via)
501504
}

0 commit comments

Comments
 (0)