Skip to content
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

OIDC callback returns 401 to browser when identity state is inactive #397

Open
5 tasks done
timblackwell opened this issue Sep 20, 2024 · 1 comment
Open
5 tasks done
Labels
bug Something is not working.

Comments

@timblackwell
Copy link

Preflight checklist

Ory Network Project

No response

Describe the bug

When there is an error, the callback should redirect to the configured Error UI URL with a flow parameter set.
This enables our UI to render the error message as desiered.

I don't want to leave the customer on Ory Network Project with JSON error in body, even if the identity is inactive.

Reproducing the bug

  1. Configure Ory Project to use Custom UI, including the Error UI URL.
  2. Register identity using OIDC provider.
  3. Set identity status to inactive.
  4. Attempt to login again, using browser based OIDC code flow.

Relevant log output

No response

Relevant configuration

No response

Version

Ory Network

On which operating system are you observing this issue?

Ory Network

In which environment are you deploying?

Ory Network

Additional Context

The redirect from Google back to Ory Network:
https://ory-network-project/self-service/methods/oidc/callback/google?state=redacted&code=redacted&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&hd=redacted&prompt=none

The response from Ory Network:

{
  "error": {
    "code": 401,
    "status": "Unauthorized",
    "request": "6d05d366-57ba-9f83-8c08-065582fa0953",
    "reason": "This account was disabled.",
    "details": { "identity_id": "redacted" },
    "message": "identity is disabled"
  }
}
@timblackwell timblackwell added the bug Something is not working. label Sep 20, 2024
@jonas-jonas
Copy link
Member

Additional context:

Use API flows, to implement the above. See the JSON error returned on the OIDC callback (this should be a redirect to the error UI instead, even for API flows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants