PHP Класс Authorizer, someline-starter

Наследование: extends Menu
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
authCodeRequestDeniedRedirectUri ( ) : string Generate a redirect uri when the auth code request is denied by the user.
checkAuthCodeRequest ( ) : null Check the validity of the auth code request.
getAccessToken ( ) : League\OAuth2\Server\Entity\AccessTokenEntity Get the current access token for the session.
getAuthCodeRequestParam ( $key, null $default = null ) : mixed Get a single parameter from the auth code request parameters.
getAuthCodeRequestParams ( ) : array Get the Auth Code request parameters.
getChecker ( ) : League\OAuth2\Server\ResourceServer Get the checker.
getClientId ( ) : string Get the client id of the current request.
getIssuer ( ) : League\OAuth2\Server\AuthorizationServer Get the issuer.
getRedirectUriGenerator ( ) : LucaDegasperi\OAuth2Server\RedirectUri Get the RedirectUri generator instance.
getResourceOwnerId ( ) : string Get the resource owner ID of the current request.
getResourceOwnerType ( ) : string Get the resource owner type of the current request (client or user).
getScopes ( ) : array get the scopes associated with the current request.
hasScope ( string | array $scope ) : boolean Check if the current request has all the scopes passed.
issueAccessToken ( ) : array Issue an access token if the request parameters are valid.
issueAuthCode ( string $ownerType, string $ownerId, array $params = [] ) : string Issue an auth code.
setRedirectUriGenerator ( $redirectUri ) Set the RedirectUri generator instance.
setRequest ( Request $request ) Set the request to use on the issuer and checker.
setTokenType ( League\OAuth2\Server\TokenType\TokenTypeInterface $tokenType ) Set the token type to use.
validateAccessToken ( boolean $httpHeadersOnly = false, string | null $accessToken = null ) : mixed Validate a request with an access token in it.

Описание методов

authCodeRequestDeniedRedirectUri() публичный статический Метод

Generate a redirect uri when the auth code request is denied by the user.
public static authCodeRequestDeniedRedirectUri ( ) : string
Результат string a correctly formed url to redirect back to

checkAuthCodeRequest() публичный статический Метод

Check the validity of the auth code request.
public static checkAuthCodeRequest ( ) : null
Результат null a response appropriate for the protocol in use

getAccessToken() публичный статический Метод

If the session does not have an active access token, an exception will be thrown.
public static getAccessToken ( ) : League\OAuth2\Server\Entity\AccessTokenEntity
Результат League\OAuth2\Server\Entity\AccessTokenEntity

getAuthCodeRequestParam() публичный статический Метод

Get a single parameter from the auth code request parameters.
public static getAuthCodeRequestParam ( $key, null $default = null ) : mixed
$key
$default null
Результат mixed

getAuthCodeRequestParams() публичный статический Метод

Get the Auth Code request parameters.
public static getAuthCodeRequestParams ( ) : array
Результат array

getChecker() публичный статический Метод

Get the checker.
public static getChecker ( ) : League\OAuth2\Server\ResourceServer
Результат League\OAuth2\Server\ResourceServer

getClientId() публичный статический Метод

Get the client id of the current request.
public static getClientId ( ) : string
Результат string

getIssuer() публичный статический Метод

Get the issuer.
public static getIssuer ( ) : League\OAuth2\Server\AuthorizationServer
Результат League\OAuth2\Server\AuthorizationServer

getRedirectUriGenerator() публичный статический Метод

Get the RedirectUri generator instance.
public static getRedirectUriGenerator ( ) : LucaDegasperi\OAuth2Server\RedirectUri
Результат LucaDegasperi\OAuth2Server\RedirectUri

getResourceOwnerId() публичный статический Метод

Get the resource owner ID of the current request.
public static getResourceOwnerId ( ) : string
Результат string

getResourceOwnerType() публичный статический Метод

Get the resource owner type of the current request (client or user).
public static getResourceOwnerType ( ) : string
Результат string

getScopes() публичный статический Метод

get the scopes associated with the current request.
public static getScopes ( ) : array
Результат array

hasScope() публичный статический Метод

Check if the current request has all the scopes passed.
public static hasScope ( string | array $scope ) : boolean
$scope string | array the scope(s) to check for existence
Результат boolean

issueAccessToken() публичный статический Метод

Issue an access token if the request parameters are valid.
public static issueAccessToken ( ) : array
Результат array a response object for the protocol in use

issueAuthCode() публичный статический Метод

Issue an auth code.
public static issueAuthCode ( string $ownerType, string $ownerId, array $params = [] ) : string
$ownerType string the auth code owner type
$ownerId string the auth code owner id
$params array additional parameters to merge
Результат string the auth code redirect url

setRedirectUriGenerator() публичный статический Метод

Set the RedirectUri generator instance.
public static setRedirectUriGenerator ( $redirectUri )
$redirectUri

setRequest() публичный статический Метод

Set the request to use on the issuer and checker.
public static setRequest ( Request $request )
$request Symfony\Component\HttpFoundation\Request

setTokenType() публичный статический Метод

Set the token type to use.
public static setTokenType ( League\OAuth2\Server\TokenType\TokenTypeInterface $tokenType )
$tokenType League\OAuth2\Server\TokenType\TokenTypeInterface

validateAccessToken() публичный статический Метод

Validate a request with an access token in it.
public static validateAccessToken ( boolean $httpHeadersOnly = false, string | null $accessToken = null ) : mixed
$httpHeadersOnly boolean whether or not to check only the http headers of the request
$accessToken string | null an access token to validate
Результат mixed