-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add Restore Credential Support for Shrine app #104
base: shrine-compose
Are you sure you want to change the base?
Conversation
Change-Id: I476116b1f3400c452783d2f172bd7adbca5fcadb
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/example/android/authentication/shrine/ui/RegisterScreen.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
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.
can the backup integration also be included to the test app?
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/example/android/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
restoreCredentialRequest, | ||
) | ||
} catch (e: Exception) { | ||
e.printStackTrace() |
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.
Do we need this?
@@ -17,16 +17,19 @@ package com.example.android.authentication.shrine | |||
|
|||
import android.annotation.SuppressLint | |||
import android.content.Context | |||
import androidx.credentials.ClearCredentialStateRequest |
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.
@neelanshsahai can we update the README to tell about RestoreCredentials functionality? @cy245 FYI
context: Context, | ||
) { | ||
val passkeysEligibility = PasskeysEligibility.isPasskeySupported(context) | ||
if (passkeysEligibility.isEligible) { |
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.
if not eligible, are we throwing any error?
|
||
suspend fun getRestoreKey( | ||
authenticationJson: JSONObject, | ||
activity: Context, |
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.
keep either activ ity or context which is more reasonable?
creationResult = jsonObject, | ||
) | ||
} | ||
getPasskey = { jsonObject -> |
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.
is it getPasskeyRequest or reponse or just a result, a bit confusing? Can we name accordingly?
context = activityContext, | ||
) | ||
} | ||
createPassword = { username: String, password: String -> |
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.
same here
Change-Id: I476116b1f3400c452783d2f172bd7adbca5fcadb