-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
AcceptLoginRequest results in EOF #1524
Comments
You need to send a JSON body with your request. It seems like you're just sending a PUT request without any content. |
The body is, referring to the docs, optional: https://www.ory.sh/docs/hydra/sdk/api#accept-an-login-request I also used the official Go SDK like this: adminURL, err := url.Parse("http://localhost:4445")
ory := hydra.NewHTTPClientWithConfig(nil, &client.TransportConfig{Schemes: []string{adminURL.Scheme}, Host: adminURL.Host, BasePath: adminURL.Path})
acceptLoginRequestParams := admin.NewAcceptLoginRequestParams()
acceptLoginRequestParams.SetLoginChallenge(request.Challenge)
resp, oryErr := ory.Admin.AcceptLoginRequest(acceptLoginRequestParams) I guess the sdk will send a request body, but i cannot say, the response is the same wheter i use the REST API or the GO SDK. |
That's a documentation issue, the body is required - otherwise hydra can not know what user authenticated. |
Ok, so what of these is the actual body i have to send? From Go sdk source code: type AcceptLoginRequestParams struct {
/*Body*/
Body *models.HandledLoginRequest
/*LoginChallenge*/
LoginChallenge string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
} And from the rest api documentation {
"acr": "string",
"context": {
"property1": {},
"property2": {}
},
"force_subject_identifier": "string",
"remember": true,
"remember_for": 0,
"subject": "string"
} Appreciate your help!! |
I think I ran into the same issue once. Now it is working for me.
I hope this helps |
Thanks all! I solved the issue with your help. |
@aeneasr I notice that this is still an issue a year later. How can we fix this documentation? |
Hi there, sorry that this hasn't been fixed in the docs yet - it's probably enough to add https://github.com/ory/hydra/blob/master/consent/doc.go#L83 Similar, this should also be done for consent and other request parameters that have a body. Would you be up for the challenge? |
When accepting a login request via hydra, the rest api/ go sdk responds with an Bad Request -> EOF.
Steps to reproduce the behavior:
Server response + logs
Logs:
Response
Server configuration
Expected behavior
Hydra sends the redirectTo Uri as response.
Environment
Additional context
A example User Service / Identity Provider should be implemented. The Client sends its email and password, the service should mark the request as accepted via hydra.
The text was updated successfully, but these errors were encountered: