Yandex is a technology company whose services include search, maps, mail, and music. Yandex ID is the account people use across those services, and Yandex OAuth lets other apps sign users in with the same account.
How does the integration work?
You can use the Yandex OAuth adapter in Appwrite Auth for user authentication and management. This can be convenient for users because they can start using your app without creating a new account. It can also be more secure, because the user has one less password that could become vulnerable.
Appwrite doesn't request specific scopes. Yandex grants the data access you select on your Yandex app, and Appwrite reads the user's ID, display name, default email address, and avatar from the Yandex ID API. The avatar also powers user photos in Appwrite Avatars. Appwrite doesn't send a redirect URI with the request, so Yandex returns users to the redirect URI saved on your app, and it must match the one Appwrite expects.
Appwrite doesn't receive a verification status for the email address from Yandex, so it stores the address as unverified. If another user in your project already has the same address, Appwrite redirects to your failure URL instead of signing in to that account. To connect Yandex to an existing account, have the user sign in first and then start createOAuth2Session from the browser, which links Yandex as a new identity.
How to implement
To implement the Yandex OAuth adapter in Appwrite Auth, there are several steps you must complete:
Step 1: Register a Yandex app
First, sign in to Yandex OAuth with the account you'll use for development and click Create app. Choose the app type for user authorization, then enter a service name, an icon, and a contact email.
Under Platforms, select Web services. The Redirect URI field is required, so temporarily add https://temporary-endpoint.com/. You will replace it with the URI from Appwrite in the next step.
Under data access, select the user's login, name, and gender, their profile picture, and their email address. Confirm the app, then save the client ID and client secret shown on the app's page for later use.
Step 2: Add the Yandex OAuth adapter to your Appwrite project
For this step, you must create an account on Appwrite Cloud or self-host Appwrite if you haven't already. In your Appwrite project, head over to the Auth page, open the Settings tab, and click Yandex under the OAuth2 Providers section.
Enter the Client ID and Client Secret you saved from Yandex, turn the provider on, and click Update.
Copy the Redirect URI shown in the provider settings. It follows this format:
https://<REGION>.cloud.appwrite.io/v1/account/sessions/oauth2/callback/yandex/<PROJECT_ID>The URI starts with the API endpoint your app uses, so on self-hosted Appwrite it starts with your own domain. Always copy the exact value from the Console. Back in Yandex OAuth, edit your app and replace the temporary URL in Redirect URI with this URI.
Step 3: Test the provider
Follow the OAuth 2 login flow to test your provider. Pass OAuthProvider.Yandex as the provider when you call createOAuth2Session from a client app or createOAuth2Token from a server. Add your app's domain as a platform in your Appwrite project so Appwrite accepts your success and failure URLs.
Read more about Yandex and Appwrite Auth
If you would like to learn more about Yandex and Appwrite Auth, we have some resources that you should visit:
