---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.com/dev/id/doc/en/mobileauthsdk/android/3.1.3/sdk-android.md
  - https://yandex.com/dev/id/doc/ru/mobileauthsdk/android/3.1.3/sdk-android.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/id/doc/en/llms.txt

# How it works

To set up SDK Yandex ID authorization in your service, follow these steps:

1. [Register your app](https://yandex.com/dev/id/doc/en/register-client.md) in the service [Yandex OAuth](https://oauth.yandex.com/).

   Under **Platforms**, select **Android app** and specify your service's parameters:
         
      * **Android package name**. The app package name (the `applicationId` field in the `build.gradle` file of your module). Read more about Android app IDs in [Android documentation](https://developer.android.com/studio/build/application-id.html).
         
      * **Android Google Play URL**. Link to the app in Google Play.
         
      * **SHA256 Fingerprints**. The certificate fingerprint of your app. Learn more about generating a fingerprint in the [Android documentation](https://developers.google.com/android/guides/client-auth#using_gradles_signing_report).

      To configure SDK Yandex ID, you'll need the [**Client ID** parameter](https://yandex.com/dev/id/doc/en/register-client.md#app-params) of the app.

1. [Add the repository and the dependencies](https://yandex.com/dev/id/doc/en/mobileauthsdk/android/3.1.3/sdk-android-install.md).

1. [Configure](https://yandex.com/dev/id/doc/en/mobileauthsdk/android/3.1.3/sdk-android-use.md) your service for using tokens.

1. Get [user information](https://yandex.com/dev/id/doc/en/user-information.md).

{% note tip %}

For security reasons, SDK Yandex ID for Android doesn't save the obtained tokens on the user's device when its work is finished.

{% endnote %}

How the SDK Yandex ID for Android works:

```mermaid
flowchart TD
    A[Start of authorization] --> B[Has a strategy been chosen?]
    B -->|No|C[Is the Yandex app installed?]
    B -->|Yes|D[What is the chosen authorization strategy?]
    D -->|NATIVE|C
    D -->|WEBVIEW|F[The webview opens]
    C -->|No|G[Is the browser installed: Chrome, Yandex Browser?]
    D -->|CHROME_TAb|G
    C -->|Yes|H[The app opens]
    G -->|No|F
    G -->|Yes|L[The browser opens]
    L -->I[Authorization]
    F -->I
    H -->J[Are the accounts in the app saved?]
    J -->|No|I
    J -->|Yes|K[Account Selection]
    K -->M[Confirmation of access rights]
    I -->M
    I -->|User rejection|N[Return to the app without tokens]
    M -->|User rejection|N
    M -->O[Requesting authorization tokens]
    O -->P[Tokens received]

    linkStyle 1,5,8,13 stroke:#ff3333,stroke-width:2px;
    linkStyle 2,7,9,14 stroke:#33ff33,stroke-width:2px;
```

