ory / ory/network

Updating native registration flow with OIDC ID token for existing identity returns breaking response

Open
#447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
96
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

https://vigorous-leakey-ouzelmh6hd.projects.oryapis.com

Describe the bug

When updating a native registration flow (POST /self-service/registration) the identity property of the successful response is marked as required in the Open API specification. That property contains details about the new identity that was created.

However, when updating the registration flow with an ID token received from an OIDC provider and Ory finds an existing identity based on the subject in the token, then a login on that identity is performed instead. When that happens, the response format instead looks like the successful response from Submit a Login Flow (POST /self-service/login). In that response there is no identity property.

When using an auto generated client, the parsing of the response might fail since the identity is required and the caller does't know the registration ended up in a login. I would expect differences between how this is handled by clients in different programming languages, but in a strictly typed language like Swift this becomes a breaking error.

Reproducing the bug
  1. Create an identity using any OIDC provider
  2. Start a registration flow by calling Create Registration Flow for Native Apps
  3. Authenticate to receive an ID token from the same provider used in step 1.
  4. Complete registration with the ID token by calling Update Registration Flow

Expected 200 response:
A JSON object containing the required identity property at root level.

Actual 200 response:
A JSON object without the required identity property at root level. The identity is however included in the session property.

Relevant log output

Relevant configuration

Version

Ory Network

On which operating system are you observing this issue?

Ory Network

In which environment are you deploying?

Ory Network

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Update Registration Flow and Create Registration Flow for Native Apps API operations linked in the report, then compare their documented success schemas with the described OIDC existing-identity response. No repository file or test is named, so trace the API specification and response handling; done means the documented contract and generated-client parsing agree for both registration and login outcomes.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.