PHP 클래스 Authorizer, someline-starter

상속: extends Menu
파일 보기 프로젝트 열기: someline/someline-starter 1 사용 예제들

공개 메소드들

메소드 설명
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