Options

class Options(scope: String?, userAgent: OAuth2Method.Options.UserAgent, customTabsBuilder: (CustomTabsIntent.Builder) -> Unit, customOptions: HashMap<String, Any>)

Represents some options to pass to a third-party OAuth2 provider.

Constructors

Options
Link copied to clipboard
fun Options(scope: String? = null, userAgent: OAuth2Method.Options.UserAgent = UserAgent.CustomTab)

Basic constructor for standard options.

Options
Link copied to clipboard
fun Options(scope: String? = null, userAgent: OAuth2Method.Options.UserAgent = UserAgent.CustomTab, customTabsBuilder: (CustomTabsIntent.Builder) -> Unit, customOptions: Array<Pair<String, Any>>)
Options
Link copied to clipboard
fun Options(scope: String? = null, userAgent: OAuth2Method.Options.UserAgent = UserAgent.CustomTab, customOption: Pair<String, Any>, vararg otherOptions: Pair<String, Any>)

Advanced constructor for provider-specific options.

Options
Link copied to clipboard
fun Options(scope: String?, userAgent: OAuth2Method.Options.UserAgent, customTabsBuilder: (CustomTabsIntent.Builder) -> Unit, customOptions: HashMap<String, Any>)

Types

Companion
Link copied to clipboard
object Companion
UserAgent
Link copied to clipboard
enum UserAgent : Enum<OAuth2Method.Options.UserAgent>

Represents the browser (or User-Agent implementation) used to display the OAuth2 provider authorize endpoint on the device.

Functions

setCustomParameter
Link copied to clipboard
fun setCustomParameter(key: String, value: Any?): OAuth2Method.Options

Adds (or removes) a custom parameter to this Options instance with a custom value.

setMCC
Link copied to clipboard
fun setMCC(): OAuth2Method.Options

Adds the "mcc" option (Mobile Country Code) to this Options instance with a value automatically guessed from the activated SIM card on the device. This option is relevant for wassup-based implicit authentication.

fun setMCC(mcc: String): OAuth2Method.Options

Adds the "mcc" option (Mobile Country Code) to this Options instance with a custom value. This option is relevant for wassup-based implicit authentication.

setScope
Link copied to clipboard
fun setScope(scope: String?): OAuth2Method.Options

Adds an OAuth2 "scope" option to this Options instance.

withCustomTabsBuilder
Link copied to clipboard
fun withCustomTabsBuilder(builder: (CustomTabsIntent.Builder) -> Unit): OAuth2Method.Options

Customizes the CustomTabsIntent.Builder used to display the OAuth2 provider authorize endpoint, when the userAgent is set to UserAgent.CustomTab (the default value). Typically, it makes it possible to update action buttons or background colors of the browser.