<@U04UQ68083H> How can I register in Ory With Pass...
# ory-copilot
a
@chilly-king-10285 How can I register in Ory With Passkey in iOS. I was looking for "publicKey" which is not coming in "https://enterbaseurl.com/self-service/login/api" get flow id for login or registration.
b
A message from kapa.ai
Based on the knowledge sources provided, I can help explain how to register with Passkey in Ory, though there are some limitations in the specific information about iOS implementation. Ory supports Passkey as one of its authentication methods, alongside others like password, OIDC, and code authentication. Passkeys are a modern authentication method that provides a more secure alternative to traditional passwords. When working with registration flows in Ory, you first need to initialize a registration flow by making a request to get a flow ID. For API clients (like a mobile app), you would use the native registration flow endpoint:
Copy code
flowId=$(curl -s -X GET \     -H "Accept: application/json" \     <https://your-project.projects.oryapis.com/self-service/registration/api> | jq -r '.id')
After obtaining the flow ID, you can fetch the registration flow details:
Copy code
curl -s -X GET \     -H "Accept: application/json" \     "<https://your-project.projects.oryapis.com/self-service/registration/flows?id=$flowId>"
For Passkey registration, you would need to look for the
passkey
method in the response. According to the documentation, when updating a registration flow with the Passkey method, you need to include the following in your request body: - `method`: Should be set to "passkey" - `passkey_register`: Contains the JSON returned by the WebAuthn registration process - `traits`: The identity's traits (like email) - `csrf_token`: The anti-CSRF token (for browser flows) [Ory API Reference](https://www.ory.sh/docs/reference/api) shows that for updating a registration flow with Passkey, you need to use the
passkey_register
field which contains the JSON returned by the WebAuthn registration process. The knowledge sources don't provide specific details about iOS implementation for Passkey registration or why the publicKey might not be appearing in your flow. The WebAuthn/Passkey implementation might require client-side JavaScript to trigger the registration process, as indicated by the presence of
onloadTrigger
fields in the API responses that can contain values like
oryPasskeyRegistration
. For a complete iOS implementation, you might need to: 1. Initialize the registration flow 2. Fetch the flow details 3. Look for Passkey-related information in the response 4. Implement the WebAuthn/Passkey client-side logic in your iOS app 5. Submit the registration with the Passkey data If you're not seeing the expected publicKey information in the API response, it might be worth checking: - If Passkey is enabled in your Ory configuration - If you're using the correct API endpoints - If there are any specific requirements for mobile implementations For more detailed guidance specific to iOS implementation, you might need to consult additional Ory documentation or support resources not included in the provided knowledge sources.
A message from kapa.ai
I understand you're looking for the "publicKey" in the Ory login/registration flow for implementing Passkey authentication in iOS. Based on the knowledge sources, when implementing Passkey authentication in Ory, you need to first ensure that the Passkey strategy is enabled in your configuration:
Copy code
selfservice:   methods:     passkey:       enabled: true       config:         rp:           display_name: Your Application name           id: localhost           origins:             - <http://localhost:4455>
For iOS implementation, you would need to: 1. First create a registration flow by calling the API endpoint 2. Look for Passkey-related information in the response 3. Use the WebAuthn/Passkey client-side logic in your iOS app When updating a registration flow with the Passkey method, you need to include: - `method`: Set to "passkey" - `passkey_register`: Contains the JSON returned by the WebAuthn registration process - `traits`: The identity's traits [Ory API Reference](https://www.ory.sh/docs/reference/api) shows that for Passkey registration, you should use the
passkey_register
field which contains the JSON returned by the WebAuthn registration process. The knowledge sources don't specifically mention a "publicKey" field in the API response for Passkey registration. Instead, the API responses contain fields like
onloadTrigger
that can have values such as
oryPasskeyRegistration
which trigger the Passkey registration process. For your identity schema, you must define which field is the display name for the passkey:
Copy code
json {   "<http://ory.sh/kratos|ory.sh/kratos>": {     "credentials": {       "passkey": {         "display_name": true       }     }   } }
If you're not seeing the expected Passkey information in the API response, check: 1. That Passkey is properly enabled in your Ory configuration 2. You're using the correct API endpoints (registration flow, not login flow) 3. Your identity schema has the proper Passkey configuration The knowledge sources don't provide iOS-specific implementation details for Passkey authentication, so you might need to consult additional Ory documentation or support resources for platform-specific guidance.