OAuth2\Service::authorize PHP Method

authorize() public method

redirect to authorize endpoint of service
public authorize ( array $userParameters = [] )
$userParameters array
    public function authorize(array $userParameters = array())
    {
        $parameters = array_merge($userParameters, array('type' => 'web_server', 'client_id' => $this->_client->getClientKey(), 'redirect_uri' => $this->_client->getCallbackUrl(), 'response_type' => 'code'));
        if ($this->_scope) {
            $parameters['scope'] = $this->_scope;
        }
        $url = $this->_configuration->getAuthorizeEndpoint();
        $url .= (strpos($url, '?') !== false ? '&' : '?') . http_build_query($parameters);
        header('Location: ' . $url);
        die;
    }