X
X
xHaikx2016-10-14 14:12:46
Classmates
xHaikx, 2016-10-14 14:12:46

OAuth authorization on the site returns the error "redirect_uri differs from the one passed at the OAuth stage", when specifying the scope parameter, why?

When passing any data to the scope (in my case, "GET_EMAIL"), a request appears to access the user's email, after confirming the rights, it redirects to the main page with the error "invalid_request: redirect_uri differs from the one passed at the OAuth stage". If the scope parameter is not specified, everything works, but email does not come accordingly.
I tried to specify various redirect_uri in the application settings, it did not help!
I am using Nodge/yii2-eauth

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xHaikx, 2016-10-27
@xHaikx

Answer from odnoklassniki Api
Team server-side OAuth is used (response_type=code), then it has 2 phases:
1. A preview opens with rights
2. After receiving the code, a request is made from your server to ours for access tokens.
In these two steps, the redirect_uri must match exactly.
Most likely, because when you request GET_EMAIL, you issue it, then you also add the permissions_granted=GET_EMAIL parameter in the second step, but this should not be so.
This is simply ridiculous, due to the fact that the GET parameter is added to the link, it is impossible to register through the social network, the link itself does not change, all other social network services work fine in them, you just need to specify the site domain (in odnoklassniki, you need to specify each page from which request up to get parameters) .
According to the logic of the odnoklassniki Api Team, I have to go into the sources of the library I use and remove the permissions_granted=GET_EMAIL parameter only for the odnoklassniki service, with the risk that all other social network services will fall, which by the way work perfectly and without any problems.
Conclusion: Either manually write the OAuth authorization logic for this "beautiful" service, or, which is clearly better, refuse to use this service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question