OAuth2ControllerFactory
extends AbstractBaseFactory
in package
OAuth2 controller factory.
Tags
Table of Contents
- $claimExtractor : ClaimExtractor
- Claim extractor
- $container : ContainerInterface
- Service manager
- $oauth2Config : array<string|int, mixed>
- OAuth2 configuration
- $pathResolver : PathResolver
- Config file path resolver
- __invoke() : object
- Create an object
- addGrantTypes() : void
- Add grant types to the server
- applyPermissions() : AbstractBase
- Apply permission settings to the controller.
- checkIfUserIdentifierFieldIsValid() : void
- Check that the user identifier field is valid.
- createAuthCodeGrant() : AuthCodeGrant
- Create an auth code grant
- createRefreshTokenGrant() : RefreshTokenGrant
- Create a refresh token grant
- getAuthorizationServerFactory() : callable
- Return a factory function for creating the authorization server.
- getClaimExtractor() : ClaimExtractor
- Get the claim extractor.
- getKeyFromConfigPath() : CryptKey
- Return a key path from the OAuth2 configuration.
- getOAuth2ServerSetting() : string
- Return a server setting from the OAuth2 configuration.
- getResourceServerFactory() : callable
- Return a ResourceServer.
- getResponseType() : ResponseTypeInterface
- Return an OAuth2 response type.
Properties
$claimExtractor
Claim extractor
protected
ClaimExtractor
$claimExtractor
= null
$container
Service manager
protected
ContainerInterface
$container
$oauth2Config
OAuth2 configuration
protected
array<string|int, mixed>
$oauth2Config
$pathResolver
Config file path resolver
protected
PathResolver
$pathResolver
Methods
__invoke()
Create an object
public
__invoke(ContainerInterface $container, string $requestedName[, null|array<string|int, mixed> $options = null ]) : object
Parameters
- $container : ContainerInterface
-
Service manager
- $requestedName : string
-
Service being created
- $options : null|array<string|int, mixed> = null
-
Extra options (optional)
Tags
Return values
object —addGrantTypes()
Add grant types to the server
protected
addGrantTypes(AuthorizationServer $server, array<string|int, mixed>|null $clientConfig) : void
Parameters
- $server : AuthorizationServer
-
Authorization server
- $clientConfig : array<string|int, mixed>|null
-
Client configuration
Return values
void —applyPermissions()
Apply permission settings to the controller.
protected
applyPermissions(ContainerInterface $container, AbstractBase $controller) : AbstractBase
Parameters
- $container : ContainerInterface
-
Service manager
- $controller : AbstractBase
-
Controller to configure
Return values
AbstractBase —checkIfUserIdentifierFieldIsValid()
Check that the user identifier field is valid.
protected
checkIfUserIdentifierFieldIsValid() : void
Tags
Return values
void —createAuthCodeGrant()
Create an auth code grant
protected
createAuthCodeGrant(array<string|int, mixed>|null $clientConfig) : AuthCodeGrant
Parameters
- $clientConfig : array<string|int, mixed>|null
-
Client configuration
Return values
AuthCodeGrant —createRefreshTokenGrant()
Create a refresh token grant
protected
createRefreshTokenGrant() : RefreshTokenGrant
Return values
RefreshTokenGrant —getAuthorizationServerFactory()
Return a factory function for creating the authorization server.
protected
getAuthorizationServerFactory() : callable
Return values
callable —getClaimExtractor()
Get the claim extractor.
protected
getClaimExtractor() : ClaimExtractor
Return values
ClaimExtractor —getKeyFromConfigPath()
Return a key path from the OAuth2 configuration.
protected
getKeyFromConfigPath(string $key) : CryptKey
Converts the path to absolute as necessary.
Parameters
- $key : string
-
Key path to return
Tags
Return values
CryptKey —getOAuth2ServerSetting()
Return a server setting from the OAuth2 configuration.
protected
getOAuth2ServerSetting(string $setting) : string
Parameters
- $setting : string
-
Setting name
Tags
Return values
string —getResourceServerFactory()
Return a ResourceServer.
protected
getResourceServerFactory() : callable
Return values
callable —getResponseType()
Return an OAuth2 response type.
protected
getResponseType() : ResponseTypeInterface