A
A
Anton2017-02-05 02:21:39
Laravel
Anton, 2017-02-05 02:21:39

OAuth. How to show a window with "allow" and "prohibit" every time you try to log in through a social network?

Hello!
I am using laravel/socialite and socialiteproviders . I did everything in the code as indicated in the documentation. Everything works, except for a couple of moments:
1. If in the window that appears (authorization, for example, via google) click "Deny", then the following error will appear:

ClientException in RequestException.php line 111:
Client error: `POST https://accounts.google.com/o/oauth2/token` resulted in a `400 Bad Request` response:
{
"error" : "invalid_request",
"error_description" : "Missing required parameter: code"
}

2. If you then click "Allow", then this:
InvalidStateException in AbstractProvider.php line 200:

Note: stateless() did not help me in any way to solve problems.
Questions:
1. How to fix these errors or how to catch them to do your validation?
2. How to make it so that when you re-authorize through the social network, a window appears with permission to receive data and a ban, and not just for the first time?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question