<@U04UQ68083H> during hydra /oauth2/auth api, if t...
# ory-copilot
g
@chilly-king-10285 during hydra /oauth2/auth api, if the user is not logged in, instead of redirecting to configured login url in hydra's configuration file, how to redirect to oidc client specific login url?
c
A message from kapa.ai
Short answer: Ory Hydra (Ory OAuth2 & OpenID Connect) redirects unauthenticated users to a single, globally configured Login URL. The knowledge sources do not mention a way to override the login URL per OAuth2 client during /oauth2/auth. Instead, you configure one login endpoint and it receives the login_challenge to proceed. If you need different behavior per client, implement that routing logic inside your custom login app (e.g., inspect the login_challenge → getOAuth2LoginRequest → client info → branch accordingly) and then accept/reject the login request. ([Custom login flow overview](https://www.ory.sh/docs/oauth2-oidc/custom-login-consent/flow), [Login endpoint example](https://www.ory.sh/docs/oauth2-oidc/custom-login-consent/flow#login-endpoint-code-example), [Configure login URL](https://www.ory.sh/docs/hydra/guides/custom-ui-oauth2#configure-ory-network))