Skip to content

Fixes the OIDC return_url param when a subpath is configured#4041

Merged
foot merged 5 commits intomainfrom
fixes-oidc-subpath-redirect
Sep 26, 2023
Merged

Fixes the OIDC return_url param when a subpath is configured#4041
foot merged 5 commits intomainfrom
fixes-oidc-subpath-redirect

Conversation

@foot
Copy link
Copy Markdown
Contributor

@foot foot commented Sep 22, 2023

  • We should return the configured subpath NOT the root which might be another app etc.
  • Also fixes the redirect_url handling for OIDC, so if you land on /sources and are redirected to signin, logging in with OIDC will also redirect you to /sources on success (and /wego/sources if a subpath it configured)

Follow up to:

To test

Spin up a kind cluster w/ ingress support:

  • Run ./tools/kind-with-ingress.sh
  • Configure OIDC w/ the correct redirectURL
    kubectl create secret generic oidc-auth \
      --namespace default \
      --from-literal=issuerURL=<issuerURL> \
      --from-literal=clientID=<clientID> \
      --from-literal=clientSecret=<clientSecret> \
      --from-literal=redirectURL=http://localhost:30080/wego/oauth2/callback
    
  • Uncomment ingress and additionalArgs sections in tools/helm-dev-values.yaml
  • tilt up
  • open http://localhost:30080 note the 404 from ingress controller
  • open http://localhost:30080/wego/ login w/ OIDC, note we are now redirected back to /wego/ and not / (which gives a 404).

- We should return the configured subpath NOT the root which might be
  another app etc.
- Also fixes the redirect_url handling for OIDC, so if you land on
  /sources and are redirected to signin, logging in with OIDC will
  also redirect you to /sources on success (and /wego/sources if a
  subpath it configured)
@foot foot marked this pull request as ready for review September 26, 2023 06:56
Copy link
Copy Markdown
Contributor

@AlinaGoaga AlinaGoaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🥳 , tested and it behaves as expected :)

@foot foot enabled auto-merge (squash) September 26, 2023 11:56
@foot foot merged commit 5db07d2 into main Sep 26, 2023
@foot foot deleted the fixes-oidc-subpath-redirect branch September 26, 2023 12:03
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.

2 participants