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

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

Receive access token from server using Authorisation Code.
public getAccessTokenByAuthCode ( string $authorizationCode ) : object
$authorizationCode string Code, received from server
Результат object stdClass with next properties : token, expireDate and error. $accesToken is invalid, when error is not null
    public function getAccessTokenByAuthCode($authorizationCode)
    {
        $grantType = 'authorization_code';
        $resource = self::URL_CORE_WINDOWS . '/';
        $this->accessToken = $this->getToken($grantType, $resource, null, $authorizationCode);
        $this->environment->keychain(\SERVER_PLATFORMS::AZURE)->properties->saveSettings([CloudCredentialsProperty::AZURE_ACCESS_TOKEN => $this->accessToken->token, CloudCredentialsProperty::AZURE_ACCESS_TOKEN_EXPIRE => $this->accessToken->expireDate]);
        return $this->accessToken;
    }