function()
{
$authorization_url = $this->apiPermission->getAuthorizationUrl();
// Get the state generated for you and store it to the session.
$_SESSION['oauth2state'] = $this->apiPermission->getProvider()->getState();
// Redirect the user to the authorization URL.
header('Location: ' . $authorization_url);
exit;
}