OAuth2Middleware
class OAuth2Middleware (View source)
Class OAuth2Middleware.
Properties
protected GrantTypeInterface | $grantType | Primary grant type. | |
protected GrantTypeInterface | $refreshTokenGrantType | Refresh token (secondary) grant type. | |
protected TokenRepositoryInterface | $tokenRepository | Token repository. | |
protected TokenInterface | $token | Token model. |
Methods
getGrantType()
Get main grant type.
getRefreshTokenGrantType()
Get refresh token grant type.
TokenInterface|null
getToken()
Get a valid access token.
getTokenRepository()
Get token repository.
__construct(GrantTypeInterface $grantType, GrantTypeInterface $refreshTokenGrantType = null, TokenRepositoryInterface $tokenRepository = null)
Constructor.
RequestInterface
requestNewToken()
Acquire a new access token from the oauth2 server.
Details
at line 51
GrantTypeInterface
getGrantType()
Get main grant type.
at line 61
setGrantType(GrantTypeInterface $grantType)
Set main grant type.
at line 71
GrantTypeInterface
getRefreshTokenGrantType()
Get refresh token grant type.
at line 81
setRefreshTokenGrantType(GrantTypeInterface $refreshTokenGrantType)
Set refresh token grant type.
at line 91
setToken(TokenInterface $token)
Set token.
at line 103
TokenInterface|null
getToken()
Get a valid access token.
at line 125
setTokenRepository(TokenRepositoryInterface $tokenRepository)
Set token repository.
at line 135
TokenRepositoryInterface
getTokenRepository()
Get token repository.
at line 147
__construct(GrantTypeInterface $grantType, GrantTypeInterface $refreshTokenGrantType = null, TokenRepositoryInterface $tokenRepository = null)
Constructor.
at line 243
protected RequestInterface
signRequest(RequestInterface $request, TokenInterface $token)
Add auth headers.
at line 259
protected TokenInterface
requestNewToken()
Acquire a new access token from the oauth2 server.