You are here

protected function Auth0::getAuthorizationCode in Auth0 Single Sign On 8.2

Get the authorization code from POST or GET, depending on response_mode

Return value

string|null

See also

https://auth0.com/docs/api-auth/tutorials/authorization-code-grant

1 call to Auth0::getAuthorizationCode()
Auth0::exchange in vendor/auth0/auth0-php/src/Auth0.php
Exchange authorization code for access, ID, and refresh tokens

File

vendor/auth0/auth0-php/src/Auth0.php, line 713

Class

Auth0
Class Auth0 Provides access to Auth0 authentication functionality.

Namespace

Auth0\SDK

Code

protected function getAuthorizationCode() {
  $code = null;
  if ($this->responseMode === 'query' && isset($_GET['code'])) {
    $code = $_GET['code'];
  }
  else {
    if ($this->responseMode === 'form_post' && isset($_POST['code'])) {
      $code = $_POST['code'];
    }
  }
  return $code;
}