Debug token

You can test apps that use OAuth with debug tokens. To get them, open Yandex OAuth in the browser with appropriate parameters. Like any other tokens, debug tokens can always be revoked.

To obtain a token manually:

  1. When registering or editing an app, at the Platforms step in the Redirect URI field, click Enter URL for debugging in the tooltip box . A URL that allows you to obtain debug tokens manually will be pasted into the field.

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

  3. Open a link that looks like this:

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

    The ID can be found in the app properties. To open them, go to Yandex OAuth and select the app name.

  4. If you haven't granted access for this app before or the issued token has expired, you'll be taken to a permission confirmation page. Click Allow to confirm the issuing of a token.

Yandex OAuth will redirect you to the token page, adding the token data after the # symbol:

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 a token couldn't be issued, the OAuth server adds an error code to the URL:

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

Possible error codes:

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