Scalr\Service\Azure::getAuthorizationCodeLocation PHP Метод

getAuthorizationCodeLocation() публичный Метод

Retrieve location where user must go to receive redirect-callback from Azure with authorization code.
public getAuthorizationCodeLocation ( ) : string
Результат string URL for access code request
    public function getAuthorizationCodeLocation()
    {
        if ($this->validateTenantName()) {
            $path = '/' . $this->tenantName . '/oauth2/authorize';
            $queryData = ['response_type' => 'code', 'client_id' => $this->appClientId, 'resource' => self::URL_MICROSOFT_ONLINE . '/'];
            $request = $this->getClient()->prepareRequest($path, 'GET', self::AUTH_API_VERSION, self::URL_LOGIN_WINDOWS, $queryData);
            $response = $this->getClient()->call($request);
            $location = null;
            if (302 == $response->getResponseCode()) {
                $location = $response->getHeader('Location');
            }
            return $location;
        } else {
            throw new AzureException('Tenant name is not valid. Failed process authorization.');
        }
    }