rough-kilobyte-98919
09/02/2025, 10:58 AMcode
group to me during registration flowchilly-king-10285
09/02/2025, 10:58 AMchilly-king-10285
09/02/2025, 10:59 AMcode
group is not being returned during the registration flow. From the configuration you shared, both password
and code
methods are enabled under the methods
section for registration. However, in the registration flow response, only the password
group nodes (such as email and password fields) are present, and there are no nodes for the code
group. This matches the issue you are experiencing. There are a few possible reasons for this: 1. Registration Method Selection: The registration flow will only return nodes for the active registration method. If the flow is initiated with the default method (e.g., password
), only those nodes will be present. The code
group nodes will only appear if the registration flow is explicitly started with the code
method as active. 2. UI/Frontend Handling: If your frontend does not provide a way to select or trigger the code
registration method, the flow will default to password
. You may need to ensure your UI allows users to choose the registration method, or you need to initiate the flow with the code
method. 3. Configuration and Hooks: Your configuration shows hooks for both password
and code
methods. If the code
method is not being triggered, double-check that the registration flow is being started with the correct method and that there are no frontend or API issues preventing this. 4. API Usage: According to the Ory API reference, the active
property in the registration flow response indicates which method is currently being used. If it is set to password
, only those nodes will be present. To get code
nodes, the flow must be started or switched to the code
method, either via the UI or by submitting the appropriate payload to the API endpoint for updating the registration flow with `method: code`[Ory API Reference](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json). Summary: If you are not seeing the code
group in the registration flow, it is likely because the flow is not being started or switched to the code
method. Ensure your frontend or API calls are correctly specifying the registration method you want to use. If you need both methods available, your UI should allow users to select between them, or you should programmatically initiate the flow with the desired method. If you need further troubleshooting, please provide details on how you are initiating the registration flow and whether you are specifying the code
method in your requests. If you believe this is a bug and you are correctly initiating the flow with the code
method but still not receiving the expected nodes, it may be worth opening an issue with detailed logs and configuration, as seen in the referenced GitHub issue where similar troubleshooting steps are discussed [Registration flow doesn't return to consent flow after verification via ajax api when using with kratos+hydra](https://github.com/ory/kratos/issues/4233).rough-kilobyte-98919
09/02/2025, 11:04 AMchilly-king-10285
09/02/2025, 11:04 AMchilly-king-10285
09/02/2025, 11:04 AMcode
method is enabled in your configuration. Then, when creating or updating the registration flow, you must specify the method
as code
in your request payload. Here’s how you can do it: 1. Enable the code method in your config Make sure your Ory Identities configuration includes: yaml selfservice: methods: code: enabled: true
This enables the code-based registration method. 2. Create the registration flow Start the registration flow as usual (browser or API). For example, using cURL for a browser flow: sh curl -X GET \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -c cookie.txt \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/registration/browser|PROJECT_SLUG.projects.oryapis.com/self-service/registration/browser>"
This will return a flow object with an id
and a UI schema. 3. Update the registration flow with the code method When submitting the registration form, set the method
to code
and include the required fields (such as traits
, csrf_token
, and, after receiving it, the code
). The request body for updating the registration flow with the code method should look like: json { "method": "code", "traits": { "email": "<mailto:user@example.com|user@example.com>" }, "csrf_token": "your_csrf_token" }
After the user receives the code (e.g., via email), submit it: json { "method": "code", "traits": { "email": "<mailto:user@example.com|user@example.com>" }, "csrf_token": "your_csrf_token", "code": "123456" }
The API expects the method
field to be set to code
for this flow to be active and for the UI nodes related to the code method to be returned in the flow response. [Kratos API Reference – updateRegistrationFlow](https://raw.githubusercontent.com/ory/kratos/master/spec/api.json) Note: If you are building a custom UI, ensure your frontend allows users to select or trigger the code
method, or programmatically set it when updating the flow. If you follow these steps and still do not see the code
group in the UI nodes, double-check your configuration and the payload you are sending to the update endpoint.rough-kilobyte-98919
09/02/2025, 12:04 PMchilly-king-10285
09/02/2025, 12:04 PMchilly-king-10285
09/02/2025, 12:04 PM/self-service/verification/browser
endpoint. For example: sh curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -c cookies.txt \ https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification/browser|PROJECT_SLUG.projects.oryapis.com/self-service/verification/browser>
This will return a flow object with an id
and UI nodes for the verification process. [Create verification flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#create-verification-flow) 2. Submit the verification flow (request a code) Submit the user's email to the verification endpoint, specifying the method
as code
and including the CSRF token: sh curl -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -b cookies.txt \ -d '{"method":"code","email":"<mailto:email@example.com|email@example.com>","csrf_token":"your-csrf-token"}' \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id>>"
The user will receive a verification code via email. [Submit verification flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#submit-verification-flow) 3. Submit the received code After the user receives the code, submit it to the same endpoint with the required fields: sh curl -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -b cookies.txt \ -d '{"method":"code","code":"123456","csrf_token":"your-csrf-token"}' \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/verification?flow=<your-flow-id>>"
If successful, the response will indicate that the address has been verified. Note: - The verification flow only supports one method at a time; the code
method is the default and recommended for new projects. - Make sure to use the correct CSRF token and cookies for browser flows. For more details and code samples, see the official documentation: [Verification flow (custom UI integration)](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#verification-flow)rough-kilobyte-98919
09/02/2025, 12:07 PMchilly-king-10285
09/02/2025, 12:07 PMchilly-king-10285
09/02/2025, 12:07 PMpasswordless_enabled
property under the code
method in your configuration. The enabled
property simply enables the method in general, but for passwordless flows specifically, you must set passwordless_enabled: true
. Example configuration: yaml selfservice: methods: code: enabled: true passwordless_enabled: true
- Use enabled: true
to enable the code method. - Use passwordless_enabled: true
to enable passwordless login/registration with one-time codes. This is confirmed in the documentation: > To enable email one-time-code, enable the one-time code strategy for passwordless: > > > selfservice: > methods: > code: > passwordless_enabled: true >
> [Email and SMS one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code) So, for passwordless flows, you need to set passwordless_enabled: true
under the code
method.