beznez's avatar

OAuth2 Setup

Hi Laracasts, I followed this article written by @esbenp to setup OAuth2 for my API. I finished setting it up and I implemented the client so that I could test that it works. I haven't been able to get it to work. When I click the 'Login to API' button, it sends a POST to http://myserver.com/login and it never finishes. It hangs here and I get no exceptions or errors of any kind. Also, when it hangs like that I cannot just refresh the page. I have to serve it on another port, if that's a clue as to what's happening. I output a bunch of log messages and I've narrowed the trouble down to this:

$guzzleResponse = $client->post(sprintf('%s/oauth/access-token', $config->get('app.url')), [
                'body' => $data
            ]);

I checked the parameters and they look good. $client is a GuzzleHttp Client. The post method inside looks like this:

public function post($url = null, array $options = [])
    {
        return $this->send($this->createRequest('POST', $url, $options));
    }

I think I may have to enable cookies in Lumen. Where would I go to find that out? Does anyone have any other ideas? @esbenp if you are able to help, I'd appreciate it.

0 likes
0 replies

Please or to participate in this conversation.