ServerFactory
class ServerFactory
Constants
| RESOURCE_SERVER_CONTEXT_KEY |
|
| protected BEARER_CONTEXT_KEY |
|
Properties
| protected ServerEntry|null | $defaultEntry | ||
| protected ServerEntry> | $entries | ||
| protected int | $nextKeyRefresh | ||
| protected list<string> | $storedKeyIds | ||
| protected Key|null | $encryptionKey | ||
| protected string|null | $cookieSigningKey | ||
| protected int | $hashSeed |
Methods
Create the worker's server and key cache.
Get the authorization server for the current settings and signing key.
Get the personal access server for the current settings and signing key.
Get the current server settings, pinned during an issuance.
Get the signing key and retain it for the supplied token lifetime.
Get the public JSON Web Key Set for the current settings.
Get the app-wide cookie signing key.
Decrypt a grant credential with the same key used during issuance.
Derive separate keys for grant encryption and API cookies once per worker.
Create and configure an instance of the Auth Code grant.
Create and configure a Refresh Token grant instance.
Create and configure an instance of the Device Code grant.
Make the authorization service instance.
Get the resource server for the current verification keys.
Get the token verifier shared by resource requests and credential management.
Share bearer validation across the current request's guards and middleware.
Get an already verified authentication failure without validating the credential again.
Identify the request inputs shared by authentication caches.
Get the current settings entry without changing a pinned issuance.
Load default keys once, or refresh database keys at the configured interval.
Get the configured file or PEM keys, including retained verification keys.
Details
at line 70
__construct(Container $app, Repository $config, Encrypter $encrypter, BearerRequestFactory $bearerRequests)
Create the worker's server and key cache.
at line 82
AuthorizationServer
authorizationServer()
Get the authorization server for the current settings and signing key.
at line 110
AuthorizationServer
personalAccessServer()
Get the personal access server for the current settings and signing key.
at line 128
ServerSettings
settings()
Get the current server settings, pinned during an issuance.
at line 136
SigningCryptKey
signingKey(DateInterval $lifetime)
Get the signing key and retain it for the supplied token lifetime.
at line 154
array
jwks()
Get the public JSON Web Key Set for the current settings.
at line 162
string
cookieKey()
Get the app-wide cookie signing key.
at line 174
string
decryptToken(string $token)
| internal | shared with token management; callers validate the payload's credential type |
Decrypt a grant credential with the same key used during issuance.
at line 184
protected void
initializeEncryptionKeys()
Derive separate keys for grant encryption and API cookies once per worker.
at line 202
protected AuthCodeGrant
makeAuthCodeGrant(ServerSettings $settings)
Create and configure an instance of the Auth Code grant.
at line 212
protected AuthCodeGrant
buildAuthCodeGrant(ServerSettings $settings)
Build the Auth Code grant instance.
at line 224
protected RefreshTokenGrant
makeRefreshTokenGrant(ServerSettings $settings)
Create and configure a Refresh Token grant instance.
at line 236
protected DeviceCodeGrant
makeDeviceCodeGrant(ServerSettings $settings)
Create and configure an instance of the Device Code grant.
at line 254
protected AuthorizationServer
makeAuthorizationServer(SigningCryptKey $key, ResponseTypeInterface|null $responseType = null, bool $personalAccess = false)
Make the authorization service instance.
at line 276
ResourceServer
resourceServer()
Get the resource server for the current verification keys.
at line 308
BearerTokenValidator
tokenValidator()
| internal | does not perform request-specific proof or authorization checks |
Get the token verifier shared by resource requests and credential management.
at line 321
ServerRequestInterface
validateAuthenticatedRequest(Request $request, bool $cache = true)
Share bearer validation across the current request's guards and middleware.
at line 361
OAuthServerException|null
authenticationError(Request $request)
| internal | used when rendering a resource authentication challenge |
Get an already verified authentication failure without validating the credential again.
at line 379
string
authenticationFingerprint(Request $request)
| internal | used by the guard and resource-server request cache |
Identify the request inputs shared by authentication caches.
at line 397
ServerEntry
entry()
| internal | shared with the issuance context |
Get the current settings entry without changing a pinned issuance.
at line 427
protected ServerEntry
defaultEntry()
Load default keys once, or refresh database keys at the configured interval.
at line 487
array
fileKeys()
| internal | shared with the signing-key repository for file imports |
Get the configured file or PEM keys, including retained verification keys.
at line 512
protected ServerEntry
makeEntry(ServerSettings $settings)
Build a worker-owned entry with validated, parsed key material.
at line 549
protected CryptKey
makeCryptKey(string $type, ServerKey $key)
Create a CryptKey instance.