private function requestAuthorizationCode($responseType, $scopes, $purpose) {
		$_SESSION[self::SESSION][self::STATE] = self::$SCOPES[$scopes][self::CODE_REQUESTED];
		if ($scopes === self::IDENTITY_TOKEN) {
			header(
				"Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query(
					array(
						self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID],
						self::RESPONSE_TYPE => $responseType,
						self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIRECT_URI],
						self::STATE => self::$SCOPES[$scopes][self::CODE_PROVIDED],
						self::SCOPES => $scopes,
						self::PURPOSE => $purpose
					)
				)
			);
		} else {
			header(
				"Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query(
					array(
						self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID],
						self::RESPONSE_TYPE => $responseType,
						self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIRECT_URI],
						self::STATE => self::$SCOPES[$scopes][self::CODE_PROVIDED],
						self::PURPOSE => $purpose
					)
				)
			);
		}
		exit;
	}
private function requestAuthorizationCode($responseType, $scopes, $purpose) {
		$_SESSION[self::SESSION][self::STATE] = self::$SCOPES[$scopes][self::CODE_REQUESTED];
		if ($scopes === self::IDENTITY_TOKEN) {
			header(
				"Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query(
					array(
						self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID],
						self::RESPONSE_TYPE => $responseType,
						self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIRECT_URI],
						self::STATE => self::$SCOPES[$scopes][self::CODE_PROVIDED],
						self::SCOPES => $scopes,
						self::PURPOSE => $purpose
					)
				)
			);
		} else {
			header(
				"Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query(
					array(
						self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID],
						self::RESPONSE_TYPE => $responseType,
						self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIRECT_URI],
						self::STATE => self::$SCOPES[$scopes][self::CODE_PROVIDED],
						self::PURPOSE => $purpose
					)
				)
			);
		}
		exit;
	}
private function requestAuthorizationCode ( $ responseType , $ scopes , $ purpose ) { $ _SESSION [ self :: SESSION ] [ self :: STATE ] = self :: $ SCOPES [ $ scopes ] [ self :: CODE_REQUESTED ] ; if ( $ scopes === self :: IDENTITY_TOKEN ) { header ( "Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query ( array ( self :: CLIENT_ID => $ _SESSION [ self :: SESSION ] [ self :: CLIENT_ID ] , self :: RESPONSE_TYPE => $ responseType , self :: REDIRECT_URI => $ _SESSION [ self :: SESSION ] [ self :: REDIRECT_URI ] , self :: STATE => self :: $ SCOPES [ $ scopes ] [ self :: CODE_PROVIDED ] , self :: SCOPES => $ scopes , self :: PURPOSE => $ purpose ) ) ) ; } else { header ( "Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query ( array ( self :: CLIENT_ID => $ _SESSION [ self :: SESSION ] [ self :: CLIENT_ID ] , self :: RESPONSE_TYPE => $ responseType , self :: REDIRECT_URI => $ _SESSION [ self :: SESSION ] [ self :: REDIRECT_URI ] , self :: STATE => self :: $ SCOPES [ $ scopes ] [ self :: CODE_PROVIDED ] , self :: PURPOSE => $ purpose ) ) ) ; } exit ; }
Request an authorization code from the OAuth server

@param string $responseType Always 'code'
@param string $scopes The type of token for which we need an authorization code (IDENTITY_TOKEN|API_TOKEN)
@param string $purpose User-readable description of the purpose for which this token will be used

@return void
Request an authorization code from the OAuth server