-
Notifications
You must be signed in to change notification settings - Fork 68
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(login): add flag to skip MAS-SSO login #477
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,9 +131,11 @@ func (c *KeycloakConnection) Logout(ctx context.Context) (err error) { | |
return &AuthError{err} | ||
} | ||
|
||
err = c.masKeycloakClient.Logout(ctx, c.clientID, "", c.masRealm, c.MASToken.RefreshToken) | ||
if err != nil { | ||
return &AuthError{err} | ||
if c.MASToken.RefreshToken != "" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible that the MAS Refresh token will not be an empty string? Are we clearing these values when the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking of it now, we might MAS refresh token wont be empty if user logins twice, first without passing the skip flag and then with the skip flag. We should clear them while passing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep :) When you log out it clears them, but if your session expires they persist. |
||
err = c.masKeycloakClient.Logout(ctx, c.clientID, "", c.masRealm, c.MASToken.RefreshToken) | ||
if err != nil { | ||
return &AuthError{err} | ||
} | ||
} | ||
|
||
c.Token.AccessToken = "" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped
auth
suffix aslogin
might be more familiar to the end user, what do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that we have the following flags:
auth-url
,mas-auth-url
so it keeps with that pattern, i.e. it is obvious thatskip-mas-auth
means thatmas-auth-url
would not be used.But I think you are correct, the command is called
login
, soskip-mas-login
fits better with that.