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 requested URL after SSO login #4495

Merged
merged 6 commits into from
Nov 10, 2020

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Nov 9, 2020

Depends on: #4496

Closes: #4370

Signed-off-by: Simon Behar [email protected]

Checklist:

state := pkgrand.RandString(10)
http.SetCookie(w, &http.Cookie{
Name: stateCookieName,
Value: state,
Name: state,
Copy link
Member Author

Choose a reason for hiding this comment

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

https://auth0.com/docs/protocols/state-parameters#use-the-stored-url-to-redirect-users recommends using the nonce/state as the name of the cookie for added security

if err != nil {
w.WriteHeader(400)
_, _ = w.Write([]byte(fmt.Sprintf("invalid state: %v", err)))
return
}
if state != cookie.Value {
Copy link
Member Author

Choose a reason for hiding this comment

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

No need to check this anymore, since the name of the cookie is the state

@simster7 simster7 marked this pull request as draft November 9, 2020 19:59
Signed-off-by: Simon Behar <[email protected]>
@simster7 simster7 marked this pull request as ready for review November 10, 2020 14:36
@simster7
Copy link
Member Author

Test failure is unrelated: #4501

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe make an engineering build and ask community member to try it out?

@simster7
Copy link
Member Author

@alexec I like that suggestion, will do.

@simster7 simster7 merged commit 0931baf into argoproj:master Nov 10, 2020
alexcapras pushed a commit to alexcapras/argo that referenced this pull request Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically redirect to requested URL after successful SSO login
3 participants