Why redirect after rejecting login? #3557
Replies: 1 comment
-
Hey @Brutus5000 When a login attempt fails during the OAuth2 flow, you indeed inform Ory Hydra about the failure by using the /oauth2/auth/requests/login/reject endpoint as you mentioned. The response from this endpoint contains a redirect URL which your login provider should redirect the user-agent to.(source) The reason for this redirection is to maintain the integrity of the OAuth2 flow. Ory Hydra manages the flow and needs to be aware of its state at all times, including when a login attempt fails. By redirecting back to Ory Hydra, you allow it to properly handle the failed login attempt and take the necessary next steps. |
Beta Was this translation helpful? Give feedback.
-
Hello there,
I'm a bit confused about the intended flow if a login fails. I tell hydra that the login failed via /oauth2/auth/requests/login/reject and it responds with a redirect url.
But I am showing the user that the login failed in my service already (nicely styled etc.). Why would I redirect back to Hydra? Would it redirect me back to the invoking client? There are plenty of reasons why a login is rejected and an outside application would need to get this information from somewhere, but how?
Beta Was this translation helpful? Give feedback.
All reactions