-
Notifications
You must be signed in to change notification settings - Fork 416
Added logout functionality through provider #190
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
Conversation
Hello! |
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'm not familiar with this flow. Does the client need to POST to this endpoint with its credentials or something?
Also what providers implement this?
@@ -158,6 +162,27 @@ func (p *Provider) Endpoint() oauth2.Endpoint { | |||
return oauth2.Endpoint{AuthURL: p.authURL, TokenURL: p.tokenURL} | |||
} | |||
|
|||
// LogoutURL returns the logout endpoints for the given provider. | |||
// See: https://openid.net/specs/openid-connect-session-1_0.html#RPLogout | |||
func (p *Provider) LogoutURL(idTokenHint string, redirectURL string, state string) string { |
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.
Where do these values come from? E.g. how would a user get the idTokenHint and redirectURL?
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.
For idTokenHint
I am using the token value, which works on Azure AD OpenID Connect. The redirectURL
I am getting off of the request url
query parameter, but sources could differ. It must be registered as a valid callback url, just like a login url. This callback makes sure that the application session is ended and can be registered separately as a logout url in Azure so that it calls all registered logout url's when a user has signed off, effectively implementing single signoff.
In my case:
http.Redirect(w, r, openIDConfig.provider.LogoutURL(openIDTokenCookie.Value, callbackURL, redirectURL), http.StatusFound)
@bruno-vwdilab fyi you don't need to wait for this to merge to access end_session_endpoint:
|
Perfect @ericchiang |
@ericchiang Are there plans to merge this or is there something that still needs to be done? |
Closed in favor of #226 |
Hi,
Had a need for
end_session_endpoint
so added this along with a utility function to add parameters mentioned in the spec.