hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Accept Login Request endpoint Needs redirect URLs for 409 and 410 Responses

Open theory opened this issue 3 years ago • 0 comments

Preflight checklist

Describe the bug

In the case of a "double submit" to the accept login request endpoint, one of the accept login request works and returns a redirection to Hydra with a login_verifier to redirect to the consent URL.

But if then another accept login request comes in with the same login_challenge , Hydra returns a 409 Conflict, which makes it impossible to get another URL with a login_verifier , so that we could still redirect to the consent URL in the end. Instead, we are only making the user restart entirely, get a new login challenge, having to enter credentials again.

Would it make sense to add additional formal responses to handle the conflict and gone use cases and return an appropriate redirect URL? For conflicts, return the same redirect URL as for the previous request. For a 410, return a URL to restart the auth process.

Reproducing the bug

  1. Start a login request
  2. Call the accept login request endpoint with the login_challenge, note the 200 response with a redirect_to field in the response
  3. Call the accept login endpoint again with the same login_challenge, note the 409 response an no redirect_to field in the response

Relevant log output

No response

Relevant configuration

No response

Version

1.11.10

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

Slack thread

theory avatar Jan 06 '23 16:01 theory