Interface Yiisoft\Yii\AuthClient\OAuthInterface
Interface for OAuth clients.
Public Methods
Method Details
Performs request to the OAuth API returning response data.
| public abstract array api ( string $apiSubUrl, string $method = 'GET', array|string $data = [], array $headers = [] ) | ||
| $apiSubUrl | string | |
| $method | string | |
| $data | array|string | |
| $headers | array | |
public function api(string $apiSubUrl, string $method = 'GET', array|string $data = [], array $headers = []): array;
Applies access token to the HTTP request instance.
| public abstract \ | ||
| $request | \ |
|
| $accessToken | Yiisoft\ |
|
public function applyAccessTokenToRequest(
RequestInterface $request,
OAuthToken $accessToken,
): RequestInterface;
| public abstract \ | ||
| $request | \ |
|
public function beforeApiRequestSend(RequestInterface $request): RequestInterface;
| public abstract string buildAuthUrl ( \ | ||
| $incomingRequest | \ |
|
| $params | array | |
public function buildAuthUrl(ServerRequestInterface $incomingRequest, array $params): string;
Creates an HTTP request for the API call.
| public abstract \ | ||
| $method | string | |
| $uri | string | |
public function createApiRequest(string $method, string $uri): RequestInterface;
| public abstract Yiisoft\ |
public function getAccessToken(): ?OAuthToken;
Defined in:
Yiisoft\
The Client id is publically visible in button urls The Client secret must not be made available publically => exclude from interface
| public abstract string getClientId ( ) |
public function getClientId(): string;
| public abstract string getReturnUrl ( \ | ||
| $request | \ |
|
public function getReturnUrl(ServerRequestInterface $request): string;
| public abstract string getTitle ( ) | ||
| return | string |
Service title. |
|---|---|---|
public function getTitle(): string;
| public abstract array getUserAttributes ( ) | ||
| return | array |
Authenticated user's attributes. |
|---|---|---|
public function getUserAttributes(): array;
| public abstract array getViewOptions ( ) | ||
| return | array |
View options in format: optionName => optionValue |
|---|---|---|
public function getViewOptions(): array;
| public abstract \ |
public function getYiisoftFactory(): YiisoftFactory;
Gets new auth token to replace expired one.
| public abstract Yiisoft\ | ||
| $token | Yiisoft\ |
|
public function refreshAccessToken(OAuthToken $token): OAuthToken;
Sets access token to be used.
| public abstract void setAccessToken ( array|Yiisoft\ | ||
| $token | array|Yiisoft\ |
|
public function setAccessToken(array|OAuthToken $token): void;
| public abstract void setAuthUrl ( string $authUrl ) | ||
| $authUrl | string | |
public function setAuthUrl(string $authUrl): void;
| public abstract void setYiisoftFactory ( \ | ||
| $factory | \ |
|
public function setYiisoftFactory(YiisoftFactory $factory): void;
User Contributed Notes
Leave a comment
Join the conversation to share a note.