EOAuth2Service::getCodeUrl PHP Method

getCodeUrl() protected method

Returns the url to request to get OAuth2 code.
protected getCodeUrl ( string $redirect_uri ) : string
$redirect_uri string url to redirect after user confirmation.
return string url to request.
    protected function getCodeUrl($redirect_uri)
    {
        $this->setState('redirect_uri', $redirect_uri);
        return $this->providerOptions['authorize'] . '?client_id=' . $this->client_id . '&redirect_uri=' . urlencode($redirect_uri) . '&scope=' . $this->scope . '&response_type=code';
    }

Usage Example

 /**
  * Returns the url to request to get OAuth2 code.
  * @param string $redirect_uri url to redirect after user confirmation.
  * @return string url to request. 
  */
 protected function getCodeUrl($redirect_uri)
 {
     $url = parent::getCodeUrl($redirect_uri);
     if (isset($_GET['js'])) {
         $url .= '&display=popup';
     }
     return $url;
 }
All Usage Examples Of EOAuth2Service::getCodeUrl