-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making realm parameter optional for passkeys (#776)
- Loading branch information
Showing
6 changed files
with
85 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ class DatabaseLoginFragment : Fragment() { | |
} | ||
|
||
binding.btSignupPasskey.setOnClickListener { | ||
passkeySignup() | ||
passkeySignup(binding.textEmail.text.toString()) | ||
} | ||
|
||
binding.btSignInPasskey.setOnClickListener { | ||
|
@@ -129,7 +129,7 @@ class DatabaseLoginFragment : Fragment() { | |
|
||
binding.btSignupPasskeyAsync.setOnClickListener { | ||
launchAsync { | ||
passkeySignupAsync() | ||
passkeySignupAsync(binding.textEmail.text.toString()) | ||
} | ||
} | ||
|
||
|
@@ -486,11 +486,11 @@ class DatabaseLoginFragment : Fragment() { | |
} | ||
} | ||
|
||
private fun passkeySignup() { | ||
private fun passkeySignup(email: String) { | ||
authenticationApiClient.signupWithPasskey( | ||
UserData( | ||
email = "jndoe@email.com" | ||
), "Username-Password-Authentication" | ||
email = email | ||
) | ||
).start(object : Callback<PasskeyRegistrationChallenge, AuthenticationException> { | ||
override fun onSuccess(result: PasskeyRegistrationChallenge) { | ||
val passKeyRegistrationChallenge = result | ||
|
@@ -558,7 +558,7 @@ class DatabaseLoginFragment : Fragment() { | |
} | ||
|
||
private fun passkeySignin() { | ||
authenticationApiClient.passkeyChallenge("Username-Password-Authentication") | ||
authenticationApiClient.passkeyChallenge() | ||
.start(object : Callback<PasskeyChallenge, AuthenticationException> { | ||
override fun onSuccess(result: PasskeyChallenge) { | ||
val passkeyChallengeResponse = result | ||
|
@@ -631,12 +631,11 @@ class DatabaseLoginFragment : Fragment() { | |
}) | ||
} | ||
|
||
private suspend fun passkeySignupAsync() { | ||
private suspend fun passkeySignupAsync(email: String) { | ||
|
||
try { | ||
val challenge = authenticationApiClient.signupWithPasskey( | ||
UserData(email = "[email protected]"), | ||
"Username-Password-Authentication" | ||
UserData(email = email) | ||
).await() | ||
|
||
val request = CreatePublicKeyCredentialRequest( | ||
|
@@ -682,7 +681,7 @@ class DatabaseLoginFragment : Fragment() { | |
try { | ||
|
||
val challenge = | ||
authenticationApiClient.passkeyChallenge("Username-Password-Authentication") | ||
authenticationApiClient.passkeyChallenge() | ||
.await() | ||
|
||
val request = GetPublicKeyCredentialOption(Gson().toJson(challenge.authParamsPublicKey)) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<resources> | ||
<string name="app_name">Auth0 SDK Sample</string> | ||
<string name="com_auth0_domain">pmathew.acmetest.org</string> | ||
<string name="com_auth0_domain">mathewp.acmetest.org</string> | ||
<string name="com_auth0_client_id">gkba7X6OJM2b0cdlUlTCqXD7AwT3FYVV</string> | ||
<string name="com_auth0_scheme">demo</string> | ||
</resources> |