high-fountain-56565
03/02/2025, 7:23 PMbrief-egg-61061
03/02/2025, 7:23 PMbrief-egg-61061
03/02/2025, 7:23 PMjson { "$id": "<https://example.com/registration.schema.json>", "$schema": "<http://json-schema.org/draft-07/schema#>", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "phone": { "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "passkey": { "display_name": true } }, "verification": { "via": "sms" } } } } } } }
This schema sets up the phone number as the primary identifier and configures it to be used with the passkey strategy. It also enables verification via SMS. 2. Enable the passkey strategy: You'll need to enable the passkey strategy in your Kratos configuration. If you're using Ory Network, you can do this through the Ory Console. Alternatively, you can use the Ory CLI or modify your configuration file directly. Using the Ory CLI: ory patch identity-config <your-project-id> \ --add '/selfservice/methods/passkey/enabled=true' \ --add '/selfservice/methods/passkey/config/rp/display_name="My Display Name"'
Or in your `config.yml`: yaml selfservice: methods: passkey: enabled: true config: rp: display_name: Your Application name id: localhost origins: - <http://localhost:4455>
3. Disable other authentication methods: Make sure to disable other authentication methods like password-based login in your Kratos configuration. By implementing these steps, you'll have a setup where users can register using their phone numbers and authenticate using passkeys without passwords. Remember to implement proper phone number verification to ensure the security of your application. You may also want to consider implementing a fallback authentication method or account recovery process in case users lose access to their passkeys. For more detailed information, you can refer to the following Ory documentation: - [Passkeys & WebAuthN](https://www.ory.sh/docs/kratos/passwordless/passkeys) - [Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number-and-password)high-fountain-56565
03/02/2025, 7:23 PM{
"$schema": "<http://json-schema.org/draft-07/schema#>",
"title": "User",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"phone_number": {
"type": "string",
"title": "Phone Number",
"format": "tel",
"minLength": 10,
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"passkey": {
"display_name": true
}
}
}
},
"first_name": {
"type": "string",
"title": "First Name"
},
"last_name": {
"type": "string",
"title": "Last Name"
},
"verified": {
"type": "boolean",
"title": "Verified",
"default": false
}
},
"required": [
"phone_number"
],
"additionalProperties": false
}
}
}
high-fountain-56565
03/02/2025, 7:24 PM{
"$schema": "<http://json-schema.org/draft-07/schema#>",
"title": "User",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"phone_number": {
"type": "string",
"title": "Phone Number",
"format": "tel",
"minLength": 10,
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"passkey": {
"display_name": true
}
}
}
},
"first_name": {
"type": "string",
"title": "First Name"
},
"last_name": {
"type": "string",
"title": "Last Name"
},
"verified": {
"type": "boolean",
"title": "Verified",
"default": false
}
},
"required": [
"phone_number"
],
"additionalProperties": false
}
}
}
brief-egg-61061
03/02/2025, 7:24 PMhigh-fountain-56565
03/02/2025, 7:24 PMversion: v1.3.0
dsn: memory
serve:
public:
base_url: <http://localhost:4433/>
cors:
enabled: true
allowed_origins:
- <http://localhost:8081>
- <http://localhost:19006>
allowed_methods:
- POST
- GET
- PUT
- PATCH
- DELETE
allowed_headers:
- Authorization
- Content-Type
- X-Session-Token
- Cookie
exposed_headers:
- Content-Type
- Set-Cookie
allow_credentials: true
admin:
base_url: <http://localhost:4434/>
selfservice:
default_browser_return_url: <http://localhost:8081/>
allowed_return_urls:
- <http://localhost:8081>
- <http://localhost:19006>
methods:
passkey:
enabled: true
config:
rp:
id: localhost
display_name: app
origins:
- <http://localhost:8081>
- <http://localhost:19006>
password:
enabled: false
flows:
settings:
ui_url: <http://localhost:8081/settings>
privileged_session_max_age: 15m
verification:
enabled: true
ui_url: <http://localhost:8081/verification>
use: code
after:
default_browser_return_url: <http://localhost:8081/>
recovery:
enabled: true
ui_url: <http://localhost:8081/recovery>
use: code
login:
ui_url: <http://localhost:8081/login>
lifespan: 10m
after:
passkey:
hooks:
- hook: revoke_active_sessions
registration:
ui_url: <http://localhost:8081/registration>
lifespan: 10m
before:
passkey:
hooks:
- hook: session
log:
level: debug
format: text
leak_sensitive_values: true
secrets:
cookie:
- NONPROD-INSECURE-SECRET
hashers:
argon2:
parallelism: 1
memory: 128MB
iterations: 2
salt_length: 16
key_length: 16
identity:
default_schema_id: user
schemas:
- id: user
url: file:///etc/config/kratos/identity.schema.json
# courier:
# smtp:
# connection_uri: <smtps://test:test@mailslurper:1025/?skip_ssl_verify=true>
brief-egg-61061
03/02/2025, 7:24 PMbrief-egg-61061
03/02/2025, 7:24 PMverification
field to the <http://ory.sh/kratos|ory.sh/kratos>
object for the phone_number
property. Here's how you can modify it: json "phone_number": { "type": "string", "title": "Phone Number", "format": "tel", "minLength": 10, "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "passkey": { "display_name": true } }, "verification": { "via": "sms" } } }
This change allows Ory Kratos to send verification codes via SMS to the user's phone number. 2. Remove the verified
field: The verified
field in your schema is not necessary. Ory Kratos handles the verification status internally, so you don't need to manage it manually in the identity schema. Here's the updated and improved version of your identity schema: json { "$schema": "<http://json-schema.org/draft-07/schema#>", "title": "User", "type": "object", "properties": { "traits": { "type": "object", "properties": { "phone_number": { "type": "string", "title": "Phone Number", "format": "tel", "minLength": 10, "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "passkey": { "display_name": true } }, "verification": { "via": "sms" } } }, "first_name": { "type": "string", "title": "First Name" }, "last_name": { "type": "string", "title": "Last Name" } }, "required": ["phone_number"], "additionalProperties": false } } }
With these changes, your identity schema is now set up to use phone numbers as the primary identifier, enable passkey authentication, and allow for phone number verification via SMS. Remember to also configure your Ory Kratos instance to enable the passkey strategy and disable other authentication methods, as mentioned in the previous answer. For more information on customizing identity schemas and implementing phone number verification, you can refer to the [Ory Kratos documentation on customizing identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number).brief-egg-61061
03/02/2025, 7:25 PMhigh-fountain-56565
03/02/2025, 7:31 PMkratos-1 | time=2025-03-02T16:40:58Z level=info msg=Encountered self-service flow error. audience=audit error=map[message:I[#/] S[] could not find a strategy to sign up with stack_trace: e] webauthn:map[enabled:false]] regi
in my container logs. any idea why?brief-egg-61061
03/02/2025, 7:31 PMbrief-egg-61061
03/02/2025, 7:32 PMkratos.yml
file: yaml selfservice: methods: passkey: enabled: true config: rp: display_name: Your Application Name id: <http://your-domain.com|your-domain.com> origins: - <https://your-domain.com>
Make sure to replace Your Application Name
and <http://your-domain.com|your-domain.com>
with your actual application details. 2. Mismatch between identity schema and enabled strategies: Your identity schema is set up to use passkeys, but the error message indicates that WebAuthn is disabled (webauthn:map[enabled:false]
). This mismatch could be causing the issue. Ensure that your identity schema matches the enabled strategies in your Kratos configuration. If you're using passkeys, make sure the WebAuthn/passkey strategy is enabled as shown in point 1. 3. External phone verification: Since you mentioned that you're doing phone verification outside of Ory, make sure that your identity schema doesn't include the verification
field for the phone number. This could potentially cause conflicts with Kratos' internal verification process. 4. Check other registration methods: If you've disabled all other registration methods (like password), make sure you haven't accidentally left any references to them in your configuration or identity schema. To get more detailed information about the error, you can increase the log level in your Kratos configuration: yaml log: level: debug format: json
This will provide more verbose logs that might give you additional insights into why the registration is failing. If you continue to face issues after making these changes, you may want to review your entire Kratos configuration and identity schema to ensure they are correctly set up for passkey-only registration with external phone verification. For more information on configuring registration flows and troubleshooting, you can refer to the [Ory Kratos documentation on registration flows](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).