0 follower

Interface Yiisoft\Yii\AuthClient\OAuthInterface

ExtendsYiisoft\Yii\AuthClient\AuthClientInterface
Implemented byYiisoft\Yii\AuthClient\OAuth2Interface

Interface for OAuth clients.

Method Details

Hide inherited methods

api() public abstract method

Performs request to the OAuth API returning response data.

public abstract api( string $apiSubUrl, string $method 'GET', array|string $data = [], array $headers = [] ): array
$apiSubUrl string
$method string
$data array|string
$headers array

                public function api(string $apiSubUrl, string $method = 'GET', array|string $data = [], array $headers = []): array;

            
applyAccessTokenToRequest() public abstract method

Applies access token to the HTTP request instance.

public abstract applyAccessTokenToRequest( \Psr\Http\Message\RequestInterface $request, Yiisoft\Yii\AuthClient\OAuthToken $accessToken ): \Psr\Http\Message\RequestInterface
$request \Psr\Http\Message\RequestInterface
$accessToken Yiisoft\Yii\AuthClient\OAuthToken

                public function applyAccessTokenToRequest(
    RequestInterface $request,
    OAuthToken $accessToken
): RequestInterface;

            
beforeApiRequestSend() public abstract method

public abstract beforeApiRequestSend( \Psr\Http\Message\RequestInterface $request ): \Psr\Http\Message\RequestInterface
$request \Psr\Http\Message\RequestInterface

                public function beforeApiRequestSend(RequestInterface $request): RequestInterface;

            
buildAuthUrl() public abstract method
public abstract buildAuthUrl( \Psr\Http\Message\ServerRequestInterface $incomingRequest, array $params ): string
$incomingRequest \Psr\Http\Message\ServerRequestInterface
$params array

                public function buildAuthUrl(ServerRequestInterface $incomingRequest, array $params): string;

            
createApiRequest() public abstract method

Creates an HTTP request for the API call.

public abstract createApiRequest( string $method, string $uri ): \Psr\Http\Message\RequestInterface
$method string
$uri string

                public function createApiRequest(string $method, string $uri): RequestInterface;

            
getAccessToken() public abstract method

public abstract getAccessToken( ): Yiisoft\Yii\AuthClient\OAuthToken|null

                public function getAccessToken(): ?OAuthToken;

            
getButtonClass() public abstract method
public abstract getButtonClass( ): string

                public function getButtonClass(): string;

            
getClientId() public abstract method

Defined in: Yiisoft\Yii\AuthClient\AuthClientInterface::getClientId()

The Client id is publically visible in button urls The Client secret must not be made available publically => exclude from interface

public abstract getClientId( ): string

                public function getClientId(): string;

            
getName() public abstract method
public abstract getName( ): string
return string

Service name.

                public function getName(): string;

            
getReturnUrl() public abstract method

public abstract getReturnUrl( \Psr\Http\Message\ServerRequestInterface $request ): string
$request \Psr\Http\Message\ServerRequestInterface

                public function getReturnUrl(ServerRequestInterface $request): string;

            
getScope() public abstract method

public abstract getScope( ): string

                public function getScope(): string;

            
getTitle() public abstract method
public abstract getTitle( ): string
return string

Service title.

                public function getTitle(): string;

            
getViewOptions() public abstract method
public abstract getViewOptions( ): array
return array

View options in format: optionName => optionValue

                public function getViewOptions(): array;

            
getYiisoftFactory() public abstract method

public abstract getYiisoftFactory( ): \Yiisoft\Factory\Factory

                public function getYiisoftFactory(): YiisoftFactory;

            
refreshAccessToken() public abstract method

Gets new auth token to replace expired one.

public abstract refreshAccessToken( Yiisoft\Yii\AuthClient\OAuthToken $token ): Yiisoft\Yii\AuthClient\OAuthToken
$token Yiisoft\Yii\AuthClient\OAuthToken

                public function refreshAccessToken(OAuthToken $token): OAuthToken;

            
setAccessToken() public abstract method

Sets access token to be used.

public abstract setAccessToken( array|Yiisoft\Yii\AuthClient\OAuthToken $token ): void
$token array|Yiisoft\Yii\AuthClient\OAuthToken

                public function setAccessToken(array|OAuthToken $token): void;

            
setAuthUrl() public abstract method

public abstract setAuthUrl( string $authUrl ): void
$authUrl string

                public function setAuthUrl(string $authUrl): void;

            
setYiisoftFactory() public abstract method

public abstract setYiisoftFactory( \Yiisoft\Factory\Factory $factory ): void
$factory \Yiisoft\Factory\Factory

                public function setYiisoftFactory(YiisoftFactory $factory): void;