Updating native registration flow with OIDC ID token for existing identity returns breaking response
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 96
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
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
- Create an identity using any OIDC provider
- Start a registration flow by calling Create Registration Flow for Native Apps
- Authenticate to receive an ID token from the same provider used in step 1.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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