-
Notifications
You must be signed in to change notification settings - Fork 165
Updates Examples.md with passkey enrollment samples #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
EXAMPLES.md
Outdated
| Use the Auth0 My Account API to manage the current user's account. | ||
|
|
||
| To call the My Account API, you need an access token issued specifically for this API, including any required scopes for the operations you want to perform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, you'd also need to add docs about getting said access token. E.g. https://github.com/auth0/Auth0.swift/blob/master/EXAMPLES.md#api-credentials-ea
Otherwise, devs could assume you have to use the audience slot (on the initial login) for that, which is not possible if they're already using their own audience value. This is precisely the problem that MRRT solves.
EXAMPLES.md
Outdated
| val client = MyAccountAPIClient(account, accessToken) | ||
|
|
||
| client.passkeyEnrollmentChallenge() | ||
| .start(object :Callback<PasskeyEnrollmentChallenge,MyAccountException>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .start(object :Callback<PasskeyEnrollmentChallenge,MyAccountException>{ | |
| .start(object: Callback<PasskeyEnrollmentChallenge, MyAccountException> { |
EXAMPLES.md
Outdated
| val client = MyAccountAPIClient(account, "accessToken") | ||
|
|
||
| try{ | ||
| val challenge = client.passkeyEnrollmentChallenge() | ||
| .await() | ||
| println("Challenge: $challenge") | ||
| } catch (exception:MyAccountException){ | ||
| print("Error: ${exception.message}") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| val client = MyAccountAPIClient(account, "accessToken") | |
| try{ | |
| val challenge = client.passkeyEnrollmentChallenge() | |
| .await() | |
| println("Challenge: $challenge") | |
| } catch (exception:MyAccountException){ | |
| print("Error: ${exception.message}") | |
| } | |
| val client = MyAccountAPIClient(account, "accessToken") | |
| try { | |
| val challenge = client.passkeyEnrollmentChallenge() | |
| .await() | |
| println("Challenge: $challenge") | |
| } catch (exception: MyAccountException) { | |
| print("Error: ${exception.message}") | |
| } |
| client.enroll(passkeyCredential,challenge) | ||
| .start(object :Callback<PasskeyAuthenticationMethod,MyAccountException>{ | ||
| override fun onSuccess(result: PasskeyAuthenticationMethod) { | ||
| println("Passkey enrolled successfully: ${result.id}") | ||
| } | ||
|
|
||
| override fun onFailure(error: MyAccountException) { | ||
| println("Error enrolling passkey: ${error.message}") | ||
| } | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| client.enroll(passkeyCredential,challenge) | |
| .start(object :Callback<PasskeyAuthenticationMethod,MyAccountException>{ | |
| override fun onSuccess(result: PasskeyAuthenticationMethod) { | |
| println("Passkey enrolled successfully: ${result.id}") | |
| } | |
| override fun onFailure(error: MyAccountException) { | |
| println("Error enrolling passkey: ${error.message}") | |
| } | |
| }) | |
| client.enroll(passkeyCredential, challenge) | |
| .start(object: Callback<PasskeyAuthenticationMethod,MyAccountException> { | |
| override fun onSuccess(result: PasskeyAuthenticationMethod) { | |
| println("Passkey enrolled successfully: ${result.id}") | |
| } | |
| override fun onFailure(error: MyAccountException) { | |
| println("Error enrolling passkey: ${error.message}") | |
| } | |
| }) |
EXAMPLES.md
Outdated
| try{ | ||
| val result = client.enroll(passkeyCredential,challenge) | ||
| .await() | ||
| println("Passkey enrolled successfully: ${result.id}") | ||
| }catch(error:MyAccountException){ | ||
| println("Error enrolling passkey: ${error.message}") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| try{ | |
| val result = client.enroll(passkeyCredential,challenge) | |
| .await() | |
| println("Passkey enrolled successfully: ${result.id}") | |
| }catch(error:MyAccountException){ | |
| println("Error enrolling passkey: ${error.message}") | |
| } | |
| try { | |
| val result = client.enroll(passkeyCredential, challenge) | |
| .await() | |
| println("Passkey enrolled successfully: ${result.id}") | |
| } catch(error: MyAccountException){ | |
| println("Error enrolling passkey: ${error.message}") | |
| } |
This PR adds examples for passkey enrollment