-
Notifications
You must be signed in to change notification settings - Fork 4
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
Logout #44
Comments
@abilioesteves I do not know if I am getting confused but I stumble upon some obstacles.
For the first problem, I found some interesting things in the issue client: Whitelist logout redirect URL per client #1004 which
Given that whisper become the default post logout URL. With access to the request, you could identify which client and store it. So that when hydra redirects to whisper again, whisper knows where to redirect. I believe that this might need the state that identifies the conversations with Whisper. For the second problem, I believe that it might be that unless I add a post logout URL, it won't logout the user but I am not sure. |
Well, I took a deeper look at the problem, and I have to agree with you, unfortunately. Whisper needs to have an endpoint to become the default post logout uri, which will then redirect the browser to the correct client endpoint on logout. That endpoint should be informed in the client registration with whisper. It is a good thing that we already started to separate hydra's interfaces from whisper's interfaces in the
Could please test this behaviour before going deeper on the issue? Maybe there's an unidentified bug with Hydra that we don't know about. Thanks! |
@claudiosegala, have you taken a look at the |
@abilioesteves I will test further to see if the second problem is a bug. I have taken a look at // createOAuth2Client calls hydra to create an oauth2 client
func (client *hydraClient) createOAuth2Client() (result *OAuth2Client, err error) {
p := path.Join(client.admin.BaseURL.Path, "/clients")
payloadData, _ := json.Marshal(
OAuth2Client{
ClientID: client.clientID,
ClientSecret: client.clientSecret,
TokenEndpointAuthMethod: client.tokenEndpointAuthMethod,
Scopes: strings.Join(client.scopes, " "),
GrantTypes: client.grantTypes,
RedirectURIs: client.RedirectURIs,
PostLogoutRedirectURIs: client.PostLogoutRedirectURIs,
})
logrus.Debugf("CreateOAuth2Client - POST payload: '%v'", payloadData)
resp, data, err := client.admin.Post(p, payloadData)
if err == nil {
if resp != nil {
if resp.StatusCode == 201 {
err = json.Unmarshal(data, &result)
return result, err
} else if resp.StatusCode == 409 {
return nil, fmt.Errorf("Conflict")
}
return nil, fmt.Errorf("Internal server error")
}
return nil, fmt.Errorf("Expecting response payload to be not null")
}
return nil, err
} |
@claudiosegala, just like the login flow, you should inform a valid |
@abilioesteves yeah, I gave a deeper look and saw that. The PR is coming. |
Whisper should adhere to the logout flow proposed by Hydra.
We need to
/logout
api to work as Hydra's Logout Provider;whisper-client
to ask for alogout_redirect_uri
on registration;The text was updated successfully, but these errors were encountered: