Topic on Talk:OAuth/For Developers

Unable to get an access token

2
Dmytrodruppov (talkcontribs)

Could help to understand the issue? I am using this endpoint to get an access token https://www.wikidata.org/w/rest.php/oauth2/access_token?client_credentials=client_credentials and providing client id and client secret

{

"error": "access_denied",

"error_description": "The resource owner or authorization server denied the request.",

"hint": "Client 4ab9e80d07a34633cdeab291fd8ead6a is not usable by user with ID 0",

"message": "The resource owner or authorization server denied the request."

}

Iluvatar (talkcontribs)

Подождите, ведь все ваши клиенты являются owner-only. Вы при регистрации клиента получили вечный токен. Больше ничего делать не надо. Просто подставляйте к запросам заголовок {"Authorization": "Bearer [token]"}. Да и в любом случае, никакого client_credentials=client_credentials в руководстве вообще нет.

Reply to "Unable to get an access token"