B
B
bw312016-07-07 15:31:16
PHP
bw31, 2016-07-07 15:31:16

How to get access_token vkontakte oauth2?

Application in the form of a website.
I do authorization as per the guide I
stop to receive a token writes:

{"error":"invalid_grant","error_description":"Code is invalid or expired."}

My link:
https://oauth.vk.com/access_token?client_id=мойид&client_secret=мойключ&redirect_uri=мойурл&code=257db363d39654cac7

I googled all over and couldn't find an answer. Tell me what's the problem.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
bw31, 2016-07-07
@bw31

That's how my problem was solved.
In general, the situation is this, you need to go to http to get the code, not https.

M
Mikhail Osher, 2016-07-07
@miraage

Why don't you use Auth Widget ?
// EDIT
If there are problems in the server part:
1) check the settings of the VK application (callback url, etc.)
2) check the links that you generate

K
kick_buttowski, 2016-07-07
@kick_buttowski

It looks like a new code has already been received,
so the request contains the old one, which is what it swears at.
You need to try to get the code again using the link
https://oauth.vk.com/authorize?client_id=1&display...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question