A
A
Artem2014-08-28 13:24:23
PHP
Artem, 2014-08-28 13:24:23

oAuth stopped working through Yandex. What could be the problem?

On my site, in addition to the rest, there is authorization through Yandex. It worked properly for a couple of years, and a week and a half or two ago it suddenly stopped working. As it turned out, the problem is that when accessing the address https://api-yaru.yandex.ru/me/, the code 403 is returned. Maybe someone is in the know, something has changed with them?
Just in case, I will explain exactly how I work with the API:
1. I send the user to

https://oauth.yandex.ru/authorize?response_type=code&client_id=MY_CLIENT_ID_HERE&display=popup

2. I send a POST request to https://oauth.yandex.ru/token with the grant_type, code, client_id and client_secret fields. Here I get the token and the token comes without errors:
{
  ["token_type"]=>
  string(6) "bearer"
  ["access_token"]=>
  string(32) "12345678901234567890123456789012"
  ["expires_in"]=>
  int(31536000)
}

3. I send a GET request to https://api-yaru.yandex.ru/me/ with headers:
curl_setopt($ch, CURLOPT_HTTPHEADER ,array(
           "Authorization: OAuth ".$token,
           "Content-Type: application/x-yaru+xml; type=person"
     ));

And here I just get 403 instead of a response.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2014-09-21
@bartwell

It turned out that you need to use a different address:

https://login.yandex.ru/info?[format=json | xml][& oauth_token=<OAuth-токен>]
. Due to the closure of the ya.ru service, the former does not work. Description is here .

M
Maxim Grechushnikov, 2014-09-02
@maxyc_webber

through uLogin everything is ok. Check the authorization of your site in the webmaster

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question