OneTap

fun OneTap(modifier: Modifier = Modifier, style: OneTapStyle = OneTapStyle.Light(), onAuth: (oAuth: OneTapOAuth?, accessToken: AccessToken) -> Unit, onAuthCode: (data: AuthCodeData, isCompletion: Boolean) -> Unit = { _, _ -> }, onFail: (oAuth: OneTapOAuth?, fail: VKIDAuthFail) -> Unit = { _, _ -> }, oAuths: Set<OneTapOAuth> = emptySet(), fastAuthEnabled: Boolean = true, signInAnotherAccountButtonEnabled: Boolean = false, authParams: VKIDAuthUiParams = VKIDAuthUiParams {})

Composable function to display a VKID One Tap login interface with multibranding. For more information how to integrate VK ID Authentication check docs https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/plan

Since

1.0.0

Parameters

modifier

Modifier for this composable.

style

The styling for the One Tap interface, default is OneTapStyle.Light

onAuth

Callback function invoked on successful authentication with an OneTapOAuth and an AccessToken. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the access token to be used for working with VK API.

onAuthCode

A callback to be invoked upon successful first step of auth - receiving auth code which can later be exchanged to access token. isCompletion is true if onAuth won't be called. This will happen if you passed auth parameters and implement their validation yourself. In that case we can't exchange auth code for access token and you should do this yourself.

onFail

Callback function invoked on authentication failure with on OneTapOAuth and a VKIDAuthFail object. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the error which happened during authorization.

oAuths

A set of OAuths to be displayed.

signInAnotherAccountButtonEnabled

Flag to enable a button for signing into another account. Note that if text doesn't fit the available width the view will be hidden regardless of the flag.

authParams

Optional params to be passed to auth. See VKIDAuthUiParams.Builder for more info.

fastAuthEnabled

Whether to fetch user. Defaults to true. In case this parameter is set to false the user data won't be fetched and user will have to confirm authorization on click. Note that this parameter doesn't support changes in runtime.


fun OneTap(modifier: Modifier = Modifier, style: OneTapStyle = OneTapStyle.Light(), onAuth: (oAuth: OneTapOAuth?, accessToken: AccessToken) -> Unit, onAuthCode: (data: AuthCodeData, isCompletion: Boolean) -> Unit = { _, _ -> }, onFail: (oAuth: OneTapOAuth?, fail: VKIDAuthFail) -> Unit = { _, _ -> }, oAuths: Set<OneTapOAuth> = emptySet(), fastAuthEnabled: Boolean = true, signInAnotherAccountButtonEnabled: Boolean = false, authParams: VKIDAuthUiParams = VKIDAuthUiParams {}, scenario: OneTapTitleScenario = OneTapTitleScenario.SignIn, subscribeToGroupId: String, onSuccessSubscribingToGroup: () -> Unit, onFailSubscribingToGroup: (VKIDGroupSubscriptionFail) -> Unit = {}, groupSubscriptionSnackbarHostState: SnackbarHostState, groupSubscriptionStyle: GroupSubscriptionStyle = GroupSubscriptionStyle.Light())

Composable function to display a VKID One Tap login interface with multibranding. For more information how to integrate VK ID Authentication check docs https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/plan

This version integrates Group Subscription flow. The flow will be shown right after successful auth. NOTE: The "groups" scope will be added automatically to the set of requested scopes.

Since

2.5.0

Parameters

modifier

Modifier for this composable.

style

The styling for the One Tap interface, default is OneTapStyle.Light

onAuth

Callback function invoked on successful authentication with an OneTapOAuth and an AccessToken. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the access token to be used for working with VK API.

onAuthCode

A callback to be invoked upon successful first step of auth - receiving auth code which can later be exchanged to access token. isCompletion is true if onAuth won't be called. This will happen if you passed auth parameters and implement their validation yourself. In that case we can't exchange auth code for access token and you should do this yourself.

onFail

Callback function invoked on authentication failure with on OneTapOAuth and a VKIDAuthFail object. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the error which happened during authorization.

oAuths

A set of OAuths to be displayed.

signInAnotherAccountButtonEnabled

Flag to enable a button for signing into another account. Note that if text doesn't fit the available width the view will be hidden regardless of the flag.

authParams

Optional params to be passed to auth. See VKIDAuthUiParams.Builder for more info.

fastAuthEnabled

Whether to fetch user. Defaults to true. In case this parameter is set to false the user data won't be fetched and user will have to confirm authorization on click. Note that this parameter doesn't support changes in runtime.

subscribeToGroupId

The id of the group the user will be subscribed to.

onSuccessSubscribingToGroup

Will be called upon successful subscription.

onFailSubscribingToGroup

Will be called upon any unsuccessful flow completion along with an description of the specific encountered error.

groupSubscriptionSnackbarHostState

The host state for snackbars. Use along with GroupSubscriptionSnackbarHost and pass the same state as there.

groupSubscriptionStyle

The widget style, can change appearance.


fun OneTap(modifier: Modifier = Modifier, style: OneTapStyle = OneTapStyle.Light(), onAuth: (oAuth: OneTapOAuth?, accessToken: AccessToken) -> Unit, onAuthCode: (data: AuthCodeData, isCompletion: Boolean) -> Unit = { _, _ -> }, onFail: (oAuth: OneTapOAuth?, fail: VKIDAuthFail) -> Unit = { _, _ -> }, oAuths: Set<OneTapOAuth> = emptySet(), fastAuthEnabled: Boolean = true, signInAnotherAccountButtonEnabled: Boolean = false, authParams: VKIDAuthUiParams = VKIDAuthUiParams {}, scenario: OneTapTitleScenario = OneTapTitleScenario.SignIn)

Composable function to display a VKID One Tap login interface with multibranding. For more information how to integrate VK ID Authentication check docs https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/plan

Since

2.1.0

Parameters

modifier

Modifier for this composable.

style

The styling for the One Tap interface, default is OneTapStyle.Light

onAuth

Callback function invoked on successful authentication with an OneTapOAuth and an AccessToken. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the access token to be used for working with VK API.

onAuthCode

A callback to be invoked upon successful first step of auth - receiving auth code which can later be exchanged to access token. isCompletion is true if onAuth won't be called. This will happen if you passed auth parameters and implement their validation yourself. In that case we can't exchange auth code for access token and you should do this yourself.

onFail

Callback function invoked on authentication failure with on OneTapOAuth and a VKIDAuthFail object. The first parameter is the OAuth which was used for authorization or null if the main flow with OneTap was used. The second parameter is the error which happened during authorization.

oAuths

A set of OAuths to be displayed.

signInAnotherAccountButtonEnabled

Flag to enable a button for signing into another account. Note that if text doesn't fit the available width the view will be hidden regardless of the flag.

authParams

Optional params to be passed to auth. See VKIDAuthUiParams.Builder for more info.

fastAuthEnabled

Whether to fetch user. Defaults to true. In case this parameter is set to false the user data won't be fetched and user will have to confirm authorization on click. Note that this parameter doesn't support changes in runtime.

scenario

Scenario for which the OneTap is used. Changes title accordingly.