Skip to content

Add Credential Manager to Auth samples #610

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

Merged
merged 8 commits into from
Feb 14, 2025
Prev Previous commit
Next Next commit
Update method name
  • Loading branch information
marinacoelho committed Feb 12, 2025
commit c41c4e57e836ea3a85190533df3b68210a6c6235
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ private void firebaseAuthWithGoogle(String idToken) {
}
// [END auth_with_google]

// [START sign_out]
private void signOut() {
// Firebase sign out
mAuth.signOut();

// [START clear_credential_stage]
private void clearCredentialState() {
// When a user signs out, clear the current user credential state from all credential providers.
ClearCredentialStateRequest clearRequest = new ClearCredentialStateRequest();
credentialManager.clearCredentialStateAsync(
Expand All @@ -177,7 +174,7 @@ public void onError(@NonNull ClearCredentialException e) {
}
});
}
// [END sign_out]
// [END clear_credential_stage]

private void updateUI(FirebaseUser user) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@ class GoogleSignInActivity : AppCompatActivity() {
}
// [END auth_with_google]

// [START sign_out]
private fun signOut() {
// Firebase sign out
auth.signOut()

// [START clear_credential_stage]
private fun clearCredentialState() {
// When a user signs out, clear the current user credential state from all credential providers.
lifecycleScope.launch {
try {
Expand All @@ -141,7 +138,7 @@ class GoogleSignInActivity : AppCompatActivity() {
}
}
}
// [END sign_out]
// [END clear_credential_stage]

private fun updateUI(user: FirebaseUser?) {
}
Expand Down