OAuthProvider.Builder

public classOAuthProvider.Builder


Class used to create instances ofOAuthProvider.

Summary

Public methods

@NonNullOAuthProvider.Builder

Configures custom parameters to be passed to the identity provider during the OAuth sign-in flow.

@NonNullOAuthProvider.Builder

Similar toaddCustomParameter, this takes a Map and adds each entry to the set of custom parameters to be passed.

@NonNullOAuthProvider

Returns anOAuthProvider created from thisBuilder.

@NonNullOAuthProvider.Builder

Sets the OAuth 2 scopes to be presented to the user during their sign-in flow with the identity provider.

Public methods

addCustomParameter

public @NonNullOAuthProvider.Builder addCustomParameter(@NonNullString paramKey, @NonNullString paramValue)

Configures custom parameters to be passed to the identity provider during the OAuth sign-in flow. Calling this method multiple times will add to the set of custom parameters being passed, rather than overwriting them (as long as key values don't collide).

Parameters
@NonNullString paramKey

the name of the custom parameter

@NonNullString paramValue

the value of the custom parameter

addCustomParameters

public @NonNullOAuthProvider.Builder addCustomParameters(@NonNullMap<StringString> customParameters)

Similar toaddCustomParameter, this takes a Map and adds each entry to the set of custom parameters to be passed. Calling this method multiple times will add to the set of custom parameters being passed, rather than overwriting them (as long as key values don't collide).

Parameters
@NonNullMap<StringString> customParameters

a dictionary of custom parameter names and values to be passed to the identity provider as part of the sign-in flow.

build

public @NonNullOAuthProvider build()

Returns anOAuthProvider created from thisBuilder.

setScopes

public @NonNullOAuthProvider.Builder setScopes(@NonNullList<String> scopes)

Sets the OAuth 2 scopes to be presented to the user during their sign-in flow with the identity provider.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.