AccessToken
class AccessToken implements ScopeAuthorizable, Arrayable, Jsonable, JsonSerializable, Transient mixin Token
Traits
Properties
| protected Token|null | $token | The token instance. |
|
| protected TValue> | $attributes | All the attributes set on the access token instance. |
|
| string | $oauth_access_token_id | ||
| string | $oauth_client_id | ||
| list<string> | $oauth_audiences | ||
| string | $oauth_user_id | ||
| string[] | $oauth_scopes |
Methods
Determine if a scope exists or is inherited in the given array.
Resolve all possible scopes.
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Create a new access token instance.
Create a new access token instance from the incoming PSR-7 request.
Determine if the token has a given scope.
Determine if the token is missing a given scope.
Determine if the token is a transient JWT token.
Revoke the token instance.
Convert the access token instance to an array.
Convert the object into something JSON serializable.
Convert the access token instance to JSON.
Dynamically determine if an attribute is set.
Dynamically retrieve the value of an attribute.
Pass dynamic methods onto the token instance.
Details
in
ResolvesInheritedScopes at line 14
protected bool
scopeExistsIn(string $scope, array $haystack)
Determine if a scope exists or is inherited in the given array.
in
ResolvesInheritedScopes at line 34
protected array
resolveInheritedScopes(string $scope)
Resolve all possible scopes.
in
ForwardsCalls at line 22
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
in
ForwardsCalls at line 52
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
in
ForwardsCalls at line 66
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
at line 52
__construct(array $attributes = [])
Create a new access token instance.
at line 62
static AccessToken
fromPsrRequest(ServerRequestInterface $request)
Create a new access token instance from the incoming PSR-7 request.
at line 70
bool
can(string $scope)
Determine if the token has a given scope.
at line 83
bool
cant(string $scope)
Determine if the token is missing a given scope.
at line 91
bool
transient()
Determine if the token is a transient JWT token.
at line 99
bool
revoke()
Revoke the token instance.
at line 128
protected Token|null
getToken()
Get the token instance.
at line 143
array
toArray()
Convert the access token instance to an array.
at line 153
array
jsonSerialize()
Convert the object into something JSON serializable.
at line 161
string
toJson(int $options = 0)
Convert the access token instance to JSON.
at line 169
bool
__isset(string $key)
Dynamically determine if an attribute is set.
at line 177
mixed
__get(string $key)
Dynamically retrieve the value of an attribute.
at line 189
mixed
__call(string $method, array $parameters)
Pass dynamic methods onto the token instance.