Updates Examples.md with passkey enrollment samples#839
Merged
Conversation
Widcket
reviewed
Jun 4, 2025
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. |
Contributor
There was a problem hiding this comment.
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.
Widcket
reviewed
Jun 4, 2025
EXAMPLES.md
Outdated
| val client = MyAccountAPIClient(account, accessToken) | ||
|
|
||
| client.passkeyEnrollmentChallenge() | ||
| .start(object :Callback<PasskeyEnrollmentChallenge,MyAccountException>{ |
Contributor
There was a problem hiding this comment.
Suggested change
| .start(object :Callback<PasskeyEnrollmentChallenge,MyAccountException>{ | |
| .start(object: Callback<PasskeyEnrollmentChallenge, MyAccountException> { |
Widcket
reviewed
Jun 4, 2025
EXAMPLES.md
Outdated
Comment on lines
+702
to
+710
| val client = MyAccountAPIClient(account, "accessToken") | ||
|
|
||
| try{ | ||
| val challenge = client.passkeyEnrollmentChallenge() | ||
| .await() | ||
| println("Challenge: $challenge") | ||
| } catch (exception:MyAccountException){ | ||
| print("Error: ${exception.message}") | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| 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}") | |
| } |
Widcket
reviewed
Jun 4, 2025
Comment on lines
+737
to
+746
| 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}") | ||
| } | ||
| }) |
Contributor
There was a problem hiding this comment.
Suggested change
| 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}") | |
| } | |
| }) |
Widcket
reviewed
Jun 4, 2025
EXAMPLES.md
Outdated
Comment on lines
+753
to
+759
| try{ | ||
| val result = client.enroll(passkeyCredential,challenge) | ||
| .await() | ||
| println("Passkey enrolled successfully: ${result.id}") | ||
| }catch(error:MyAccountException){ | ||
| println("Error enrolling passkey: ${error.message}") | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| 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}") | |
| } |
Widcket
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds examples for passkey enrollment