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

# LoginSDK for iOS

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 **iOS app** and specify your service's parameters:
         
   * **iOS App ID**. The exact ID of the iOS app, for example `A1B2C3D4E5.com.domain.application`. It consists of a Prefix and a Bundle ID. Learn more about iOS app IDs in the [Apple documentation](https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/AppID.html).

   * **iOS AppStore URL**. Link to the app in the AppStore.

   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. [Install](https://yandex.com/dev/id/doc/en/mobileauthsdk/ios/archive/3.0.0/sdk-ios-install.md) the YandexLoginSDK library and modify the config files.

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

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

{% note info %}

SDK Yandex ID for iOS lets you save tokens to device storage. When called, SDK Yandex ID checks for saved tokens and only sends an authorization request if no tokens are found.

{% endnote %}

How the SDK Yandex ID for iOS works:

```mermaid
flowchart TD
    A[Start of authorization] --> B[Do tokens exist in the repository?]
    B -->|No|D[What is the chosen authorization strategy?]
    D -->|.default|E[Are there any Yandex apps on your device that support authorization?]
    D -->|.webOnly|F[The SafariViewController opens]
    E -->|Да|G[Authorization in the Yandex app]
    E -->|Нет|F
    F --> H[Does the user confirm the authorization?]
    G --> H
    H -->|No|I[LoginSDK notifies the application of an error that has occurred]
    B -->|Yes|C[The application receives an OAuth token and a JSON Web Token]
    H -->|Yes|C

    linkStyle 1,5,8 stroke:#ff3333,stroke-width:2px;
    linkStyle 4,9,10 stroke:#33ff33,stroke-width:2px;
```
