File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
auth/app/src/main/java/com/google/firebase/quickstart/auth Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -83,18 +83,19 @@ public void onStart() {
83
83
}
84
84
// [END on_start_check_user]
85
85
86
- // [START launch_credential_manager]
87
86
private void launchCredentialManager () {
88
- // Create the configuration for the Credential Manager request
87
+ // [START create_credential_manager_request]
88
+ // Instantiate a Google sign-in request
89
89
GetGoogleIdOption googleIdOption = new GetGoogleIdOption .Builder ()
90
90
.setFilterByAuthorizedAccounts (true )
91
91
.setServerClientId (getBaseContext ().getString (R .string .default_web_client_id ))
92
92
.build ();
93
93
94
- // Create the Credential Manager request using the configuration created above
94
+ // Create the Credential Manager request
95
95
GetCredentialRequest request = new GetCredentialRequest .Builder ()
96
96
.addCredentialOption (googleIdOption )
97
97
.build ();
98
+ // [END create_credential_manager_request]
98
99
99
100
// Launch Credential Manager UI
100
101
credentialManager .getCredentialAsync (
@@ -116,7 +117,6 @@ public void onError(GetCredentialException e) {
116
117
}
117
118
);
118
119
}
119
- // [END launch_credential_manager]
120
120
121
121
// [START create_google_id_token]
122
122
private void createGoogleIdToken (Credential credential ) {
Original file line number Diff line number Diff line change @@ -60,18 +60,20 @@ class GoogleSignInActivity : AppCompatActivity() {
60
60
}
61
61
// [END on_start_check_user]
62
62
63
- // [START launch_credential_manager]
63
+
64
64
private fun launchCredentialManager () {
65
- // Create the configuration for the Credential Manager request
65
+ // [START create_credential_manager_request]
66
+ // Instantiate a Google sign-in request
66
67
val googleIdOption = GetGoogleIdOption .Builder ()
67
68
.setFilterByAuthorizedAccounts(true )
68
69
.setServerClientId(baseContext.getString(R .string.default_web_client_id))
69
70
.build()
70
71
71
- // Create the Credential Manager request using the configuration created above
72
+ // Create the Credential Manager request
72
73
val request = GetCredentialRequest .Builder ()
73
74
.addCredentialOption(googleIdOption)
74
75
.build()
76
+ // [END create_credential_manager_request]
75
77
76
78
lifecycleScope.launch {
77
79
try {
@@ -88,7 +90,6 @@ class GoogleSignInActivity : AppCompatActivity() {
88
90
}
89
91
}
90
92
}
91
- // [END launch_credential_manager]
92
93
93
94
// [START create_google_id_token]
94
95
private fun createGoogleIdToken (credential : Credential ) {
You can’t perform that action at this time.
0 commit comments