GetSignInWithGoogleOption

public final class GetSignInWithGoogleOption extends GetCustomCredentialOption


透過明確的「使用 Google 帳戶登入」按鈕擷取使用者 Google ID 權杖的要求。

想要提供這個憑證類型的憑證提供者必須檢查傳入的 GetCustomCredentialOption 類型是否為 GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_CREDENTIAL,而對應的 requestDatacandidateQueryData 必須含有 GoogleIdTokenCredential.BUNDLE_KEY_GOOGLE_ID_TOKEN_SUBTYPE 鍵和 GoogleIdTokenCredential.TYPE_GOOGLE_ID_TOKEN_SIWG_CREDENTIAL 的值

擲回
java.lang.IllegalArgumentException java.lang.IllegalArgumentException

如果 serverClientId 空白

com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException

使用套件建立 GetSignInWithGoogleOption 時如果發生任何錯誤。

摘要

巢狀類型

GetSignInWithGoogleOption 的 Builder 類別

公用建構函式

GetSignInWithGoogleOption(
    @NonNull String serverClientId,
    String hostedDomainFilter,
    String nonce
)

公用方法

static final @NonNull GetSignInWithGoogleOption

透過指定 Bundle 建立 GetSignInWithGoogleOption 的輔助函式。

final String

代管網域篩選器 (例如 myuniveristy.edu)

final String

產生 ID 權杖時要使用的 Nonce

final @NonNull String

核發 ID 權杖的伺服器用戶端 ID

公用建構函式

GetSignInWithGoogleOption

public GetSignInWithGoogleOption(
    @NonNull String serverClientId,
    String hostedDomainFilter,
    String nonce
)

公用方法

createFrom

public static final @NonNull GetSignInWithGoogleOption createFrom(@NonNull Bundle data)

透過指定 Bundle 建立 GetSignInWithGoogleOption 的輔助函式。

參數
@NonNull Bundle data

內含 GetSignInWithGoogleOption 所有必要資訊的套裝組合。

getHostedDomainFilter

public final String getHostedDomainFilter()

代管網域篩選器 (例如 myuniveristy.edu)

getNonce

public final String getNonce()

產生 ID 權杖時要使用的 Nonce

getServerClientId

public final @NonNull String getServerClientId()

核發 ID 權杖的伺服器用戶端 ID