clean-piano-39737
12/22/2024, 8:11 PMbrief-egg-61061
12/22/2024, 8:11 PMbrief-egg-61061
12/22/2024, 8:11 PMcurl -X POST -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"method":"password","traits.phone":"<phone_number>","password":"<password>"}' \ "https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<your-flow-id|projects.oryapis.com/self-service/registration?flow=<your-flow-id>>"
This request is based on the example provided in the [Ory Kratos documentation for submitting a registration flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#submit-registration-flow). However, you need to make a few adjustments: 1. Replace traits.email
with traits.phone
and provide the phone number. 2. Ensure your identity schema is configured to use the phone number as an identifier for password-based authentication. To use a phone number for registration, your identity schema should include a configuration similar to this: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } } } } } }
This configuration is based on the example from the [Ory Kratos documentation on customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number). Remember to replace <your-project-slug>
with your actual project slug, <your-flow-id>
with the registration flow ID, <phone_number>
with the actual phone number, and <password>
with the desired password. Also, note that depending on your configuration, you might need to include additional fields or follow up with a verification step using an SMS code.clean-piano-39737
12/22/2024, 11:54 PMbrief-egg-61061
12/22/2024, 11:54 PMbrief-egg-61061
12/22/2024, 11:55 PMemail
. The email
is the login identifier and is used for email verification and for account recovery." If you're using this default schema, your registration request would look like this: curl -X POST -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"method":"password","traits":{"email":"<mailto:user@example.com|user@example.com>"},"password":"password123"}' \ "https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<your-flow-id|projects.oryapis.com/self-service/registration?flow=<your-flow-id>>"
2. Custom Schema for Phone: If you want to use phone numbers instead of or in addition to email, you need to customize your identity schema. The [Ory documentation on customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number) provides an example of how to include a phone number in your schema: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } } } } } }
With this custom schema, you can then use a phone number for registration: curl -X POST -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"method":"password","traits":{"phone":"+1234567890"},"password":"password123"}' \ "https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<your-flow-id|projects.oryapis.com/self-service/registration?flow=<your-flow-id>>"
In summary, the default schema uses email, not phone. If you want to use phone numbers, you need to customize your identity schema. You can use either email or phone (or both) depending on your schema configuration.clean-piano-39737
12/22/2024, 11:56 PMbrief-egg-61061
12/22/2024, 11:56 PMbrief-egg-61061
12/22/2024, 11:57 PMyaml
selfservice:
methods:
code:
passwordless_enabled: true
2. Next, you need to modify your identity schema to support SMS-based authentication. Here's an example of how your schema should look, based on the [Ory documentation on customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier):
json
{
"properties": {
"traits": {
"type": "object",
"properties": {
"phone": {
"type": "string",
"format": "tel",
"title": "Phone Number",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "sms"
}
}
}
}
}
}
}
}
3. You also need to configure an SMS channel for sending the one-time codes. This involves setting up an SMS provider as described in the [Ory documentation on sending SMS](https://www.ory.sh/docs/kratos/emails-sms/sending-sms).
Once you have these configurations in place, the registration process will involve two steps:
1. The user submits their phone number.
2. Ory sends a one-time code via SMS, which the user then enters to complete the registration.
The exact API calls for this process aren't explicitly provided in the knowledge sources, but based on the general Ory API structure, it would likely involve:
1. Initiating a registration flow:
GET https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration/api|projects.oryapis.com/self-service/registration/api>
2. Submitting the phone number:
POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>>
Content-Type: application/json
{
"method": "code",
"traits": {
"phone": "+1234567890"
}
}
3. Submitting the received code:
POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>>
Content-Type: application/json
{
"method": "code",
"code": "123456"
}
Please note that the exact structure of these API calls might vary based on your specific configuration and the latest version of Ory Kratos. You should refer to the most up-to-date API documentation for the precise request format.brief-egg-61061
12/22/2024, 11:57 PMyaml selfservice: methods: code: passwordless_enabled: true
2. Next, you need to modify your identity schema to support SMS-based authentication. Here's an example of how your schema should look, based on the [Ory documentation on customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier): json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "title": "Phone Number", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } } } } } } } }
3. You also need to configure an SMS channel for sending the one-time codes. This involves setting up an SMS provider as described in the [Ory documentation on sending SMS](https://www.ory.sh/docs/kratos/emails-sms/sending-sms). Once you have these configurations in place, the registration process will involve two steps: 1. The user submits their phone number. 2. Ory sends a one-time code via SMS, which the user then enters to complete the registration. The exact API calls for this process aren't explicitly provided in the knowledge sources, but based on the general Ory API structure, it would likely involve: 1. Initiating a registration flow: GET https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration/api|projects.oryapis.com/self-service/registration/api>
2. Submitting the phone number: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>> Content-Type: application/json { "method": "code", "traits": { "phone": "+1234567890" } }
3. Submitting the received code: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>> Content-Type: application/json { "method": "code", "code": "123456" }
Please note that the exact structure of these API calls might vary based on your specific configuration and the latest version of Ory Kratos. You should refer to the most up-to-date API documentation for the precise request format. [Ory Documentation: Passwordless one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code) [Ory Documentation: Customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier) [Ory Documentation: Sending SMS](https://www.ory.sh/docs/kratos/emails-sms/sending-sms)clean-piano-39737
12/22/2024, 11:58 PMadditionalProperties \"phone\" not allowed
.brief-egg-61061
12/22/2024, 11:58 PMbrief-egg-61061
12/22/2024, 11:58 PMjson { "$id": "<https://schemas.ory.sh/presets/kratos/quickstart/phone-password/identity.schema.json>", "$schema": "<http://json-schema.org/draft-07/schema#>", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "title": "Phone number", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } }, "verification": { "via": "sms" } } } }, "additionalProperties": false } } }
This example is based on the [Ory documentation for phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification). 2. Check your Ory Kratos configuration. Make sure you've enabled the necessary methods for phone-based authentication. For example: yaml selfservice: methods: code: enabled: true passwordless_enabled: true
3. If you're using a custom configuration, ensure that you haven't accidentally disallowed additional properties. In your schema, you should have "additionalProperties": false
only within the traits
object, not at the top level of the schema. 4. If you're using Ory Network, make sure you're using the latest version of Ory Kratos. Some configuration options might have changed in recent versions. If you continue to encounter issues, it might be helpful to review your entire configuration and compare it with the examples provided in the Ory documentation. If the problem persists, you may want to reach out to Ory support or post your full configuration (with sensitive information redacted) on the Ory community forums for more specific assistance. [Ory Documentation: Phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification)clean-piano-39737
12/23/2024, 11:12 AMbrief-egg-61061
12/23/2024, 11:12 AMbrief-egg-61061
12/23/2024, 11:12 AMGET https://<your-project-slug>.<http://projects.oryapis.com/self-service/login/api|projects.oryapis.com/self-service/login/api>
2. Then, you can submit the phone number to request a verification code: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/login?flow=<flow-id|projects.oryapis.com/self-service/login?flow=<flow-id>> Content-Type: application/json { "method": "code", "identifier": "+1234567890" }
This request is based on the structure described in the [Ory API Reference for updateLoginFlow](https://www.ory.sh/docs/reference/api#tag/frontend/operation/updateLoginFlow). The "method": "code"
indicates that you're using the one-time code method, and the "identifier"
field contains the phone number. After sending this request, Ory Kratos will generate a verification code and send it via SMS to the provided phone number. The system is designed this way to maintain security and prevent unauthorized access to verification codes. If you need the verification code to be returned in the response for testing or development purposes, this isn't a standard feature of Ory Kratos. You might need to consider setting up a custom SMS provider that logs the codes for development environments, but this approach is not recommended for production use due to security concerns. For production use, it's strongly recommended to follow the standard flow where the code is sent via SMS, as this is more secure and aligns with best practices for authentication. [Ory API Reference: updateLoginFlow](https://www.ory.sh/docs/reference/api#tag/frontend/operation/updateLoginFlow)clean-piano-39737
12/23/2024, 11:23 AM{"error":{"code":500,"status":"Internal Server Error","message":"mail: missing '@' or angle-addr"}}
. Maybe because this identity had email schema when created and was updated after to have phone schema. How can I fix this?
And how can I update identity_credential_type to have "code" identity_credential_type id?brief-egg-61061
12/23/2024, 11:23 AMbrief-egg-61061
12/23/2024, 11:23 AMjson
{
"properties": {
"traits": {
"type": "object",
"properties": {
"phone": {
"type": "string",
"format": "tel",
"title": "Phone number",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "sms"
}
},
"verification": {
"via": "sms"
}
}
}
}
}
}
}
b) After updating the schema, you may need to update the existing identities to match the new schema. Unfortunately, the knowledge sources don't provide a direct method for this. You might need to use the Ory Kratos API to update each identity individually.
2. Regarding updating the identity_credential_type to include "code":
The identity_credential_type is typically managed internally by Ory Kratos based on your schema and configuration. To enable the "code" credential type, you need to ensure that your Ory Kratos configuration includes the following:
yaml
selfservice:
methods:
code:
enabled: true
passwordless_enabled: true
However, it's important to note that changing schemas and credential types for existing identities can be complex and may lead to inconsistencies. The Ory documentation doesn't provide a straightforward method for updating existing identities' credential types.
Given the complexity of your situation, I would recommend the following steps:
1. Ensure your schema and configuration are correctly set up for phone-based authentication as shown above.
2. For existing identities, you might need to create new identities with the correct schema and migrate the data, rather than trying to update the existing ones.
3. If you need to keep the existing identities, you may need to use the Ory Kratos API to update each identity manually. However, this process is not well-documented and could potentially lead to issues.brief-egg-61061
12/23/2024, 11:23 AMjson { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "title": "Phone number", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } } } } } }
b) After updating the schema, you may need to update the existing identities to match the new schema. Unfortunately, the knowledge sources don't provide a direct method for this. You might need to use the Ory Kratos API to update each identity individually. 2. Regarding updating the identity_credential_type to include "code": The identity_credential_type is typically managed internally by Ory Kratos based on your schema and configuration. To enable the "code" credential type, you need to ensure that your Ory Kratos configuration includes the following: yaml selfservice: methods: code: enabled: true passwordless_enabled: true
However, it's important to note that changing schemas and credential types for existing identities can be complex and may lead to inconsistencies. The Ory documentation doesn't provide a straightforward method for updating existing identities' credential types. Given the complexity of your situation, I would recommend the following steps: 1. Ensure your schema and configuration are correctly set up for phone-based authentication as shown above. 2. For existing identities, you might need to create new identities with the correct schema and migrate the data, rather than trying to update the existing ones. 3. If you need to keep the existing identities, you may need to use the Ory Kratos API to update each identity manually. However, this process is not well-documented and could potentially lead to issues. If these steps don't resolve your issue, you may need to reach out to Ory support directly for more specific guidance on migrating identities from email to phone-based authentication, as this seems to be a complex use case that isn't fully covered in the public documentation. [Ory Documentation: Passwordless one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code) [Ory Documentation: Customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier)clean-piano-39737
12/23/2024, 11:33 AM"I[#/traits/phone] S[#/properties/traits/properties/phone] credentials.code.via has unknown value \"sms\""
.
My request body is something like this:
[
{
"op": "replace",
"path": "/schema_id",
"value": "phone_schema_v0"
},
{
"op": "replace",
"path": "/traits",
"value": {
"phone": "+21234567890"
}
},
{
"op": "add",
"path": "/verifiable_addresses",
"value": [
{
"value": "+21234567890",
"verified": false,
"via": "sms",
"status": "pending"
}
]
}
]
brief-egg-61061
12/23/2024, 11:33 AMbrief-egg-61061
12/23/2024, 11:34 AMphone_schema_v0
) might not be correctly configured to support SMS-based verification. To resolve this, you need to ensure that your identity schema for phone_schema_v0
is properly set up to use SMS for the code credential. Here's how the phone trait in your schema should be configured: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "title": "Phone number", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } } } } } }
This configuration is based on the examples provided in the [Ory documentation for phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification) and [passwordless one-time-code login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier). Once you've updated your schema configuration, you should be able to use the PATCH request you provided to update the identity. However, note that changing an identity's schema and traits can be a complex operation, and you might need to handle the transition carefully, especially if you're changing from email to phone as the primary identifier. If you continue to encounter issues after updating your schema, you may need to: 1. Verify that the phone_schema_v0
is correctly defined and uploaded to your Ory Kratos instance. 2. Ensure that your Ory Kratos configuration has SMS verification enabled. 3. Consider creating a new identity with the correct schema instead of updating an existing one, as changing core identity attributes can sometimes lead to unexpected issues. If the problem persists after these steps, you might need to reach out to Ory support for more specific assistance, as there might be additional configuration or compatibility issues that are not covered in the public documentation. [Ory Documentation: Phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification) [Ory Documentation: Passwordless one-time-code login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier)clean-piano-39737
12/23/2024, 11:51 AM"credentials": {
"password": {
"type": "password",
"identifiers": [
"<mailto:test@test.com|test@test.com>"
],
"version": 0,
...
}
},
which I don't think is not phone schema compliant.brief-egg-61061
12/23/2024, 11:51 AMbrief-egg-61061
12/23/2024, 11:51 AMidentifiers
field under the password
credential type indicates that the identity still retains its original email-based authentication method.
2. This behavior is consistent with Ory's approach to maintaining backwards compatibility and data integrity. Changing an identity's fundamental authentication method (from email to phone in this case) is not automatically handled by simply updating the schema.
To fully transition this identity to a phone-based authentication system, you may need to take additional steps:
1. Remove the existing password credential:
You can use the Admin API to delete the existing password credential. However, the exact endpoint for this operation is not provided in the given knowledge sources.
2. Add a new code-based credential for the phone number:
After removing the password credential, you should add a new credential of type "code" for the phone number. Again, the specific API call for this is not detailed in the provided knowledge sources.
3. Update the verifiable addresses:
Ensure that the phone number is added as a verifiable address and the email address is removed (if it's no longer needed).
Here's an example of how your PATCH request might look to update the verifiable addresses:
json
[
{
"op": "replace",
"path": "/verifiable_addresses",
"value": [
{
"value": "+21234567890",
"verified": false,
"via": "sms",
"status": "pending"
}
]
}
]
It's important to note that these operations are sensitive and can potentially lock users out of their accounts if not done correctly. The Ory documentation doesn't provide explicit guidance on this kind of transition, which suggests it's not a common or recommended operation.
Given the complexity and potential risks involved in this transition, I would strongly recommend:
1. Testing this process thoroughly in a non-production environment.
2. Considering creating new identities with the desired schema instead of updating existing ones.
3. Reaching out to Ory support for guidance on the best way to handle this transition, as it involves changing core authentication methods for existing identities.
If you must proceed with updating existing identities, you may need to use a combination of API calls to remove old credentials, add new ones, and update verifiable addresses. However, the exact sequence and API endpoints for these operations are not clearly documented in the provided knowledge sources.
[Ory Documentation: Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema)brief-egg-61061
12/23/2024, 11:51 AMidentifiers
field under the password
credential type indicates that the identity still retains its original email-based authentication method. 2. This behavior is consistent with Ory's approach to maintaining backwards compatibility and data integrity. Changing an identity's fundamental authentication method (from email to phone in this case) is not automatically handled by simply updating the schema. To fully transition this identity to a phone-based authentication system, you may need to take additional steps: 1. Remove the existing password credential: You can use the Admin API to delete the existing password credential. However, the exact endpoint for this operation is not provided in the given knowledge sources. 2. Add a new code-based credential for the phone number: After removing the password credential, you should add a new credential of type "code" for the phone number. Again, the specific API call for this is not detailed in the provided knowledge sources. 3. Update the verifiable addresses: Ensure that the phone number is added as a verifiable address and the email address is removed (if it's no longer needed). Here's an example of how your PATCH request might look to update the verifiable addresses: json [ { "op": "replace", "path": "/verifiable_addresses", "value": [ { "value": "+21234567890", "verified": false, "via": "sms", "status": "pending" } ] } ]
It's important to note that these operations are sensitive and can potentially lock users out of their accounts if not done correctly. The Ory documentation doesn't provide explicit guidance on this kind of transition, which suggests it's not a common or recommended operation. Given the complexity and potential risks involved in this transition, I would strongly recommend: 1. Testing this process thoroughly in a non-production environment. 2. Considering creating new identities with the desired schema instead of updating existing ones. 3. Reaching out to Ory support for guidance on the best way to handle this transition, as it involves changing core authentication methods for existing identities. If you must proceed with updating existing identities, you may need to use a combination of API calls to remove old credentials, add new ones, and update verifiable addresses. However, the exact sequence and API endpoints for these operations are not clearly documented in the provided knowledge sources. [Ory Documentation: Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema) Remember, changing authentication methods for existing users is a sensitive operation that can have security implications. Always prioritize the security and accessibility of user accounts when making such changes.clean-piano-39737
12/23/2024, 5:28 PM{
"properties": {
"traits": {
"type": "object",
"properties": {
"phone": {
"type": "string",
"title": "Phone number",
"format": "tel",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "sms"
}
},
"verification": {
"via": "sms"
}
}
}
}
}
}
}
What are the available values options for via
key inside code
credential?brief-egg-61061
12/23/2024, 5:28 PMbrief-egg-61061
12/23/2024, 5:29 PMvia
key inside the code
credential. The error you're encountering suggests that there might be an issue with the schema configuration. Let's look at the correct configuration for the via
key in the code
credential: According to the [Ory documentation on passwordless one-time-code login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier), the available options for the via
key inside the code
credential are: 1. "email" 2. "sms" Here's an example of the correct configuration for each: For email: json { "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "email" } } } }
For SMS: json { "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } } } }
The error you're seeing might be due to a formatting issue in your JSON. I notice that in your configuration, the <http://ory.sh/kratos|ory.sh/kratos>
key is formatted as a URL (<http://ory.sh/kratos|ory.sh/kratos>
). This is incorrect and likely the cause of your error. The correct format should be: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "title": "Phone number", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } } } } } }
Make sure to use "<http://ory.sh/kratos|ory.sh/kratos>"
as a plain string key, not a URL. This should resolve the error you're encountering. [Ory Documentation: Passwordless one-time-code login identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier)clean-piano-39737
12/26/2024, 9:40 AMbrief-egg-61061
12/26/2024, 9:40 AMbrief-egg-61061
12/26/2024, 9:40 AMyaml
selfservice:
methods:
code:
enabled: true
passwordless_enabled: true
[Ory Documentation: Passwordless one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code#enable-sms-one-time-code-otp)
2. Configure the identity schema:
Update your identity schema to include phone number as an identifier for the code method:
json
{
"properties": {
"traits": {
"type": "object",
"properties": {
"phone": {
"type": "string",
"format": "tel",
"title": "Phone Number",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "sms"
}
},
"verification": {
"via": "sms"
}
}
}
}
}
}
}
[Ory Documentation: Customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier)
3. Configure SMS delivery:
Set up an SMS channel in your Ory configuration:
yaml
courier:
channels:
- id: sms
type: http
request_config:
url: <https://api.your-sms-provider.com/send>
method: POST
body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgVG86IGN0eC5yZWNpcGllbnQsCiAgQm9keTogY3R4LmJvZHksCn0>=
headers:
Content-Type: application/json
auth:
type: basic_auth
config:
user: your_username
password: your_password
[Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms)
Regarding returning the code in an HTTP response without sending it via SMS, this is not a standard feature of Ory Kratos due to security concerns. Ory Kratos is designed to send verification codes through secure channels like SMS or email to maintain the integrity of the authentication process.
Now, let's look at the HTTP requests for registration, login, and recovery:
1. Registration:
POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>>
Content-Type: application/json
{
"method": "code",
"traits": {
"phone": "+1234567890"
}
}
2. Login:
POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/login?flow=<flow-id|projects.oryapis.com/self-service/login?flow=<flow-id>>
Content-Type: application/json
{
"method": "code",
"identifier": "+1234567890"
}
brief-egg-61061
12/26/2024, 9:40 AMyaml selfservice: methods: code: enabled: true passwordless_enabled: true
[Ory Documentation: Passwordless one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code#enable-sms-one-time-code-otp) 2. Configure the identity schema: Update your identity schema to include phone number as an identifier for the code method: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "title": "Phone Number", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } } } } } }
[Ory Documentation: Customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#passwordless-one-time-code-login-identifier) 3. Configure SMS delivery: Set up an SMS channel in your Ory configuration: yaml courier: channels: - id: sms type: http request_config: url: <https://api.your-sms-provider.com/send> method: POST body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgVG86IGN0eC5yZWNpcGllbnQsCiAgQm9keTogY3R4LmJvZHksCn0>= headers: Content-Type: application/json auth: type: basic_auth config: user: your_username password: your_password
[Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms) Regarding returning the code in an HTTP response without sending it via SMS, this is not a standard feature of Ory Kratos due to security concerns. Ory Kratos is designed to send verification codes through secure channels like SMS or email to maintain the integrity of the authentication process. Now, let's look at the HTTP requests for registration, login, and recovery: 1. Registration: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/registration?flow=<flow-id|projects.oryapis.com/self-service/registration?flow=<flow-id>> Content-Type: application/json { "method": "code", "traits": { "phone": "+1234567890" } }
2. Login: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/login?flow=<flow-id|projects.oryapis.com/self-service/login?flow=<flow-id>> Content-Type: application/json { "method": "code", "identifier": "+1234567890" }
3. Recovery: POST https://<your-project-slug>.<http://projects.oryapis.com/self-service/recovery?flow=<flow-id|projects.oryapis.com/self-service/recovery?flow=<flow-id>> Content-Type: application/json { "method": "code", "identifier": "+1234567890" }
After each of these requests, Ory Kratos will send an SMS with a verification code to the provided phone number. The user then needs to submit this code in a subsequent request to complete the process. [Ory Documentation: Passwordless one-time-code authentication](https://www.ory.sh/docs/kratos/passwordless/one-time-code) Remember, these are general structures and might need to be adjusted based on your specific Ory Kratos configuration and version. Always refer to the most recent Ory documentation for the most up-to-date information.clean-piano-39737
12/26/2024, 9:49 AM{
"channel": "sms",
"priority": 1,
"recipient_list": "01012345678",
"template_id": "0267c1df-62e5-4c79-9ae1-326e69737e75",
"template_parameters": {
"code": "generated_code"
}
}
brief-egg-61061
12/26/2024, 9:49 AMbrief-egg-61061
12/26/2024, 9:49 AMyaml
courier:
channels:
- id: sms
type: http
request_config:
url: <https://your-custom-notification-service.com/send-sms>
method: POST
body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgImNoYW5uZWwiOiAic21zIiwKICAicHJpb3JpdHkiOiAxLAogICJyZWNpcGllbnRfbGlzdCI6IGN0eC5yZWNpcGllbnQsCiAgInRlbXBsYXRlX2lkIjogIjAyNjdjMWRmLTYyZTUtNGM3OS05YWUxLTMyNmU2OTczN2U3NSIsCiAgInRlbXBsYXRlX3BhcmFtZXRlcnMiOiB7CiAgICAiY29kZSI6IGN0eC50ZW1wbGF0ZV9kYXRhLlZlcmlmaWNhdGlvbkNvZGUKICB9Cn0>=
headers:
Content-Type: application/json
auth:
type: api_key
config:
name: Authorization
value: Bearer your-api-key
in: header
The body
field contains a Base64-encoded Jsonnet template. When decoded, it looks like this:
jsonnet
function(ctx) {
"channel": "sms",
"priority": 1,
"recipient_list": ctx.recipient,
"template_id": "0267c1df-62e5-4c79-9ae1-326e69737e75",
"template_parameters": {
"code": ctx.template_data.VerificationCode
}
}
This template will generate the JSON payload in the format you specified, using the recipient's phone number and the generated verification code.
2. You'll also need to ensure that your identity schema is configured to use SMS for verification and authentication. Here's an example of how your schema should look:
json
{
"properties": {
"traits": {
"type": "object",
"properties": {
"phone": {
"type": "string",
"format": "tel",
"title": "Phone Number",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"code": {
"identifier": true,
"via": "sms"
}
},
"verification": {
"via": "sms"
}
}
}
}
}
}
}
3. Make sure you've enabled the code method in your Ory Kratos configuration:
yaml
selfservice:
methods:
code:
enabled: true
passwordless_enabled: true
With these configurations in place, when Ory Kratos needs to send an SMS, it will make a POST request to your custom notification service with the payload formatted as you specified.
Remember to replace <https://your-custom-notification-service.com/send-sms>
with the actual URL of your notification service, and your-api-key
with the appropriate API key for authentication.
[Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms)brief-egg-61061
12/26/2024, 9:49 AMyaml courier: channels: - id: sms type: http request_config: url: <https://your-custom-notification-service.com/send-sms> method: POST body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgImNoYW5uZWwiOiAic21zIiwKICAicHJpb3JpdHkiOiAxLAogICJyZWNpcGllbnRfbGlzdCI6IGN0eC5yZWNpcGllbnQsCiAgInRlbXBsYXRlX2lkIjogIjAyNjdjMWRmLTYyZTUtNGM3OS05YWUxLTMyNmU2OTczN2U3NSIsCiAgInRlbXBsYXRlX3BhcmFtZXRlcnMiOiB7CiAgICAiY29kZSI6IGN0eC50ZW1wbGF0ZV9kYXRhLlZlcmlmaWNhdGlvbkNvZGUKICB9Cn0>= headers: Content-Type: application/json auth: type: api_key config: name: Authorization value: Bearer your-api-key in: header
The body
field contains a Base64-encoded Jsonnet template. When decoded, it looks like this: jsonnet function(ctx) { "channel": "sms", "priority": 1, "recipient_list": ctx.recipient, "template_id": "0267c1df-62e5-4c79-9ae1-326e69737e75", "template_parameters": { "code": ctx.template_data.VerificationCode } }
This template will generate the JSON payload in the format you specified, using the recipient's phone number and the generated verification code. 2. You'll also need to ensure that your identity schema is configured to use SMS for verification and authentication. Here's an example of how your schema should look: json { "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "title": "Phone Number", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "code": { "identifier": true, "via": "sms" } }, "verification": { "via": "sms" } } } } } } }
3. Make sure you've enabled the code method in your Ory Kratos configuration: yaml selfservice: methods: code: enabled: true passwordless_enabled: true
With these configurations in place, when Ory Kratos needs to send an SMS, it will make a POST request to your custom notification service with the payload formatted as you specified. Remember to replace <https://your-custom-notification-service.com/send-sms>
with the actual URL of your notification service, and your-api-key
with the appropriate API key for authentication. [Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms) Please note that this setup assumes your custom notification service can handle the template ID and parameters as specified. If you need to make any adjustments to the payload format, you can modify the Jsonnet template in the body
field of the courier configuration.clean-piano-39737
12/26/2024, 10:13 AMinvalid parameter
errors I'm getting when I try your courier configuration, I updated it to the following:
yaml
courier:
channels:
sms:
request_config:
url: <https://your-custom-notification-service.com/send-sms>
method: POST
body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgImNoYW5uZWwiOiAic21zIiwKICAicHJpb3JpdHk>iOiAxLAogICJyZWNpcGllbnRfbGlzdCI6IGN0eC5yZWNpcGllbnQsCiAgInRlbXBsYXRlX2lkIjogIjAyNjdjMWRmLTYyZTUtNGM3OS05YWUxLTMyNmU2OTczN2U3NSIsCiAgInRlbXBsYXRlX3BhcmFtZXRlcnMiOiB7CiAgICAiY29kZSI6IGN0eC50ZW1wbGF0ZV9kYXRhLlZlcmlmaWNhdGlvbkNvZGUKICB9Cn0=
headers:
Content-Type: application/json
auth:
type: api_key
config:
name: Authorization
value: Bearer your-api-key
in: header
I updated the - id: smd
and removed type: HTTP
line as Kratos fails to start without this change.
But I'm getting this error when I send registration request:
{
"error": {
"code": 500,
"status": "Internal Server Error",
"reason": "Expected sms template but got <nil>",
"message": "An internal server error occurred, please contact the system administrator"
}
}
brief-egg-61061
12/26/2024, 10:13 AMbrief-egg-61061
12/26/2024, 10:13 AMyaml
courier:
channels:
- type: sms
config:
url: <https://your-custom-notification-service.com/send-sms>
method: POST
body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgImNoYW5uZWwiOiAic21zIiwKICAicHJpb3JpdHkiOiAxLAogICJyZWNpcGllbnRfbGlzdCI6IGN0eC5yZWNpcGllbnQsCiAgInRlbXBsYXRlX2lkIjogIjAyNjdjMWRmLTYyZTUtNGM3OS05YWUxLTMyNmU2OTczN2U3NSIsCiAgInRlbXBsYXRlX3BhcmFtZXRlcnMiOiB7CiAgICAiY29kZSI6IGN0eC50ZW1wbGF0ZV9kYXRhLlZlcmlmaWNhdGlvbkNvZGUKICB9Cn0>=
headers:
Content-Type: application/json
auth:
type: api_key
config:
name: Authorization
value: Bearer your-api-key
in: header
The main changes are:
- We've added back the type: sms
(not http
as previously suggested).
- We've changed request_config
to just config
.
- We've removed the angle brackets (<>
) around the URL and base64 string.
2. Error Message:
The error message "Expected sms template but got <nil>" suggests that Ory Kratos is unable to find the SMS template it needs to send the message. This could be because we haven't configured the SMS templates yet.
To resolve this, we need to add SMS templates to your configuration. Here's how you can do it:
yaml
courier:
templates:
verification_code:
valid:
sms:
body:
plaintext: <base64://WW91ciB2ZXJpZmljYXRpb24gY29kZSBpczoge3sgLlZlcmlmaWNhdGlvbkNvZGUgfX0>=
login_code:
valid:
sms:
body:
plaintext: <base64://WW91ciBsb2dpbiBjb2RlIGlzOiB7eyAuTG9naW5Db2RlIH19>
This configuration sets up templates for verification and login codes. The base64-encoded strings decode to:
- Verification: "Your verification code is: {{ .VerificationCode }}"
- Login: "Your login code is: {{ .LoginCode }}"
You can customize these messages as needed, but make sure to encode them in base64.
3. Additional Configuration:
Make sure you have also configured the following in your Ory Kratos configuration:
yaml
selfservice:
methods:
code:
enabled: true
passwordless_enabled: true
This enables the code-based authentication method.
After making these changes, try restarting Ory Kratos and attempt the registration process again. If you're still encountering issues, please provide any new error messages you receive.
[Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms)
[Ory Documentation: Email templates](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates)brief-egg-61061
12/26/2024, 10:13 AMyaml courier: channels: - type: sms config: url: <https://your-custom-notification-service.com/send-sms> method: POST body: <base64://ZnVuY3Rpb24oY3R4KSB7CiAgImNoYW5uZWwiOiAic21zIiwKICAicHJpb3JpdHkiOiAxLAogICJyZWNpcGllbnRfbGlzdCI6IGN0eC5yZWNpcGllbnQsCiAgInRlbXBsYXRlX2lkIjogIjAyNjdjMWRmLTYyZTUtNGM3OS05YWUxLTMyNmU2OTczN2U3NSIsCiAgInRlbXBsYXRlX3BhcmFtZXRlcnMiOiB7CiAgICAiY29kZSI6IGN0eC50ZW1wbGF0ZV9kYXRhLlZlcmlmaWNhdGlvbkNvZGUKICB9Cn0>= headers: Content-Type: application/json auth: type: api_key config: name: Authorization value: Bearer your-api-key in: header
The main changes are: - We've added back the type: sms
(not http
as previously suggested). - We've changed request_config
to just config
. - We've removed the angle brackets (<>
) around the URL and base64 string. 2. Error Message: The error message "Expected sms template but got <nil>" suggests that Ory Kratos is unable to find the SMS template it needs to send the message. This could be because we haven't configured the SMS templates yet. To resolve this, we need to add SMS templates to your configuration. Here's how you can do it: yaml courier: templates: verification_code: valid: sms: body: plaintext: <base64://WW91ciB2ZXJpZmljYXRpb24gY29kZSBpczoge3sgLlZlcmlmaWNhdGlvbkNvZGUgfX0>= login_code: valid: sms: body: plaintext: <base64://WW91ciBsb2dpbiBjb2RlIGlzOiB7eyAuTG9naW5Db2RlIH19>
This configuration sets up templates for verification and login codes. The base64-encoded strings decode to: - Verification: "Your verification code is: {{ .VerificationCode }}" - Login: "Your login code is: {{ .LoginCode }}" You can customize these messages as needed, but make sure to encode them in base64. 3. Additional Configuration: Make sure you have also configured the following in your Ory Kratos configuration: yaml selfservice: methods: code: enabled: true passwordless_enabled: true
This enables the code-based authentication method. After making these changes, try restarting Ory Kratos and attempt the registration process again. If you're still encountering issues, please provide any new error messages you receive. [Ory Documentation: Send SMS to your users](https://www.ory.sh/docs/kratos/emails-sms/sending-sms) [Ory Documentation: Email templates](https://www.ory.sh/docs/kratos/emails-sms/custom-email-templates) Remember, when working with SMS in Ory Kratos, it's important to have both the channel configuration (which defines how to send the SMS) and the templates (which define the content of the SMS) properly set up.clean-piano-39737
12/26/2024, 10:36 AM{"audience":"audit","error":{"debug":"","message":"An internal server error occurred, please contact the system administrator","reason":"Expected sms template but got <nil>","stack_trace":"\<http://ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).registrationSendEmail|ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).registrationSendEmail>\n\t/project/selfservice/strategy/code/strategy_registration.go:196\ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).Register\n\t/project/selfservice/strategy/code/strategy_registration.go:156\ngithub.com/ory/kratos/selfservice/flow/registration.(*Handler).updateRegistrationFlow\n\t/project/selfservice/flow/registration/handler.go:648\ngithub.com/ory/kratos/selfservice/flow/registration.(*Handler).RegisterPublicRoutes.(*Handler).IsNotAuthenticated.func3\n\t/project/session/handler.go:928\ngithub.com/ory/kratos/x.(*RouterPublic).POST.NoCacheHandle.func1\n\t/project/x/nocache.go:21\ngithub.com/ory/kratos/x.(*RouterPublic).Handle.NoCacheHandle.func1\n\t/project/x/nocache.go:21\ngithub.com/julienschmidt/httprouter.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/julienschmidt/httprouter@v1.3.0/router.go:387\ngithub.com/ory/nosurf.(*CSRFHandler).handleSuccess\n\t/go/pkg/mod/github.com/ory/nosurf@v1.2.7/handler.go:234\ngithub.com/ory/nosurf.(*CSRFHandler).ServeHTTP\n\t/go/pkg/mod/github.com/ory/nosurf@v1.2.7/handler.go:185\ngithub.com/ory/kratos/cmd/daemon.servePublic.MaxBytesHandler.func4\n\t/usr/local/go/src/net/http/server.go:3906\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/urfave/negroni.(*Negroni).UseHandler.Wrap.func1\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:46\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/ory/kratos/x.init.func1\n\t/project/x/clean_url.go:15\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/rs/cors.(*Cors).ServeHTTP\n\t/go/pkg/mod/github.com/rs/cors@v1.11.0/cors.go:324\ngithub.com/ory/kratos/cmd/daemon.servePublic.func1\n\t/project/cmd/daemon/serve.go:114\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerResponseSize.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:284\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:142\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:92\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:104\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerRequestSize.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:234\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220","status":"Internal Server Error","status_code":500},"http_request":{"headers":{"accept":"application/json","accept-encoding":"gzip","content-length":"55","content-type":"application/json","user-agent":"curl/7.81.0"},"host":"localhost:4455","method":"POST","path":"/self-service/registration","query":"flow=23b8e262-ff0a-4b55-8ae4-b11e67b6e99b","remote":"172.18.0.9:40890","scheme":"http"},"level":"info","msg":"Encountered self-service flow error.","registration_flow":{"Type":"api","active":"","id":"23b8e262-ff0a-4b55-8ae4-b11e67b6e99b","nid":"5944a518-c6b5-4288-a4e5-495a14a32274","request_url":"<http://localhost:4455/self-service/registration/api>","return_to":"","state":"choose_method"},"service_name":"Ory Kratos","service_version":"v1.3.1","time":"2024-12-26T10:33:10.672883219Z"}
kratos | {"audience":"application","error":{"debug":"","message":"An internal server error occurred, please contact the system administrator","reason":"Expected sms template but got <nil>","stack_trace":"\<http://ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).registrationSendEmail|ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).registrationSendEmail>\n\t/project/selfservice/strategy/code/strategy_registration.go:196\ngithub.com/ory/kratos/selfservice/strategy/code.(*Strategy).Register\n\t/project/selfservice/strategy/code/strategy_registration.go:156\ngithub.com/ory/kratos/selfservice/flow/registration.(*Handler).updateRegistrationFlow\n\t/project/selfservice/flow/registration/handler.go:648\ngithub.com/ory/kratos/selfservice/flow/registration.(*Handler).RegisterPublicRoutes.(*Handler).IsNotAuthenticated.func3\n\t/project/session/handler.go:928\ngithub.com/ory/kratos/x.(*RouterPublic).POST.NoCacheHandle.func1\n\t/project/x/nocache.go:21\ngithub.com/ory/kratos/x.(*RouterPublic).Handle.NoCacheHandle.func1\n\t/project/x/nocache.go:21\ngithub.com/julienschmidt/httprouter.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/julienschmidt/httprouter@v1.3.0/router.go:387\ngithub.com/ory/nosurf.(*CSRFHandler).handleSuccess\n\t/go/pkg/mod/github.com/ory/nosurf@v1.2.7/handler.go:234\ngithub.com/ory/nosurf.(*CSRFHandler).ServeHTTP\n\t/go/pkg/mod/github.com/ory/nosurf@v1.2.7/handler.go:185\ngithub.com/ory/kratos/cmd/daemon.servePublic.MaxBytesHandler.func4\n\t/usr/local/go/src/net/http/server.go:3906\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/urfave/negroni.(*Negroni).UseHandler.Wrap.func1\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:46\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/ory/kratos/x.init.func1\n\t/project/x/clean_url.go:15\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/rs/cors.(*Cors).ServeHTTP\n\t/go/pkg/mod/github.com/rs/cors@v1.11.0/cors.go:324\ngithub.com/ory/kratos/cmd/daemon.servePublic.func1\n\t/project/cmd/daemon/serve.go:114\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerResponseSize.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:284\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:142\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:92\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:104\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220\ngithub.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerRequestSize.func1\n\t/go/pkg/mod/github.com/prometheus/client_golang@v1.13.0/prometheus/promhttp/instrument_server.go:234\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2220","status":"Internal Server Error","status_code":500},"http_request":{"headers":{"accept":"application/json","accept-encoding":"gzip","content-length":"55","content-type":"application/json","user-agent":"curl/7.81.0"},"host":"localhost:4455","method":"POST","path":"/self-service/registration","query":"flow=23b8e262-ff0a-4b55-8ae4-b11e67b6e99b","remote":"172.18.0.9:40890","scheme":"http"},"http_response":{"status_code":500},"level":"error","msg":"An error occurred while handling a request","service_name":"Ory Kratos","service_version":"v1.3.1","time":"2024-12-26T10:33:10.672984738Z"}
brief-egg-61061
12/26/2024, 10:36 AMbrief-egg-61061
12/26/2024, 10:36 AM