GetGoogleIdOption

public final class GetGoogleIdOption extends GetCustomCredentialOption


要求擷取使用者的 Google ID 權杖。

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

如果 serverClientId 為空白

java.lang.IllegalArgumentException java.lang.IllegalArgumentException

如果 filterByAuthorizedAccountsrequestVerifiedPhoneNumber 都為 true。

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

從套件建立 GetGoogleIdOption 時發生任何錯誤。

摘要

巢狀類型

public final class GetGoogleIdOption.Builder

GetGoogleIdOption 的建構工具。

public static class GetGoogleIdOption.Companion

公用建構函式

GetGoogleIdOption(
    @NonNull String serverClientId,
    String nonce,
    boolean filterByAuthorizedAccounts,
    String linkedServiceId,
    List<@NonNull String> idTokenDepositionScopes,
    boolean requestVerifiedPhoneNumber,
    boolean autoSelectEnabled
)

公用方法

static final @NonNull GetGoogleIdOption

輔助函式,可從指定的 Bundle 建立 GetGoogleIdOption。

final boolean

在要求中設定自動選取行為。

final boolean

是否只允許使用者選取已授權登入應用程式的 Google 帳戶,預設值為 true

final List<@NonNull String>

Google 將需要用來將 Google ID 權杖存入應用程式後端伺服器的 OAuth 範圍。

final String

連結帳戶至 Google 帳戶時使用的服務 ID

final String

在產生 ID 權杖時使用的 Nonce

final boolean

是否要在註冊時要求使用已驗證的電話號碼。

final @NonNull String

要向其發出 ID 權杖的伺服器用戶端 ID

公用建構函式

GetGoogleIdOption

public GetGoogleIdOption(
    @NonNull String serverClientId,
    String nonce,
    boolean filterByAuthorizedAccounts,
    String linkedServiceId,
    List<@NonNull String> idTokenDepositionScopes,
    boolean requestVerifiedPhoneNumber,
    boolean autoSelectEnabled
)

公用方法

createFrom

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

輔助函式,可從指定的 Bundle 建立 GetGoogleIdOption。

參數
@NonNull Bundle data

包含 GetGoogleIdOption 所有必要資訊的 Bunble。

getAutoSelectEnabled

public final boolean getAutoSelectEnabled()

在要求中設定自動選取行為。

getFilterByAuthorizedAccounts

public final boolean getFilterByAuthorizedAccounts()

是否只允許使用者選取已授權登入應用程式的 Google 帳戶,預設值為 true

getIdTokenDepositionScopes

public final List<@NonNull StringgetIdTokenDepositionScopes()

Google 需要將 Google ID 權杖存入應用程式後端伺服器的 Oauth 範圍。這是選用值,可設為空值。只有在 Google 要求特定權限才能存放 ID 權杖時,才需要使用這個屬性。

getLinkedServiceId

public final String getLinkedServiceId()

連結帳戶至 Google 帳戶時使用的服務 ID

getNonce

public final String getNonce()

在產生 ID 權杖時使用的 Nonce

getRequestVerifiedPhoneNumber

public final boolean getRequestVerifiedPhoneNumber()

是否要在註冊時要求使用已驗證的電話號碼。

getServerClientId

public final @NonNull String getServerClientId()

要發出 ID 權杖的伺服器用戶端 ID