Debug token

Applications that use OAuth can be tested using debug tokens. To get them, open Yandex OAuth in the browser with the required parameters. Debug tokens, like all others, can always be revoked.

To get a token manually:

  1. When registering or editing the app, click Set URL for debugging in the suggestion window that appears in the Redirect URI field at the App platforms stage. The field will be filled with a test URL you can use to get debug tokens manually.

  2. Log in to Yandex with the user account the app should request access to.

  3. Click the following link:

    https://oauth.yandex.com/authorize?response_type=token&client_id=<app ID>
    

    The app ID is available in the app properties. To open properties, go to Yandex OAuth and click the app name.

  4. If you didn't allow access to this app or the lifetime of the issued token expired, you'll be redirected to confirm access. Click Allow to confirm the issuing of the token.

Yandex OAuth redirects you to the token page, adding the token data after the # character:

https://oauth.yandex.com/verification_code#access_token=<new OAuth token>&expires_in=<token lifetime in seconds>

Parameter

Description

access_token

An OAuth token with the requested rights or with the rights specified when registering the app.

expires_in

Token lifetime in seconds.

If the token couldn't be issued, the OAuth server adds an error code to the URL:

https://oauth.yandex.com/verification_code#error=<error code>

Error codes:

  • unauthorized_client: The app was rejected during moderation or is awaiting moderation. Also returned if the app is blocked.