The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

Authorization Server

Resource Server

Repository Interfaces

Access Token Repository Interface

getNewToken() : AccessTokenEntityInterface

This method should return an implementation of \League\OAuth2\Server\Entities\AccessTokenEntityInterface. You can use the following traits to help you implement the required methods from that interface:

persistNewAccessToken() : void

When a new access token is created this method will be called. You don’t have to do anything here but for auditing you probably want to.

The access token entity passed in has a number of methods you can call which contain data worth saving to a database:

JWT access tokens contain an expiry date and so will be rejected automatically when used. You can safely clean up expired access tokens from your database.

revokeAccessToken() : void

This method is called when a refresh token is used to reissue an access token. The original access token is revoked a new access token is issued.

isAccessTokenRevoked() : boolean

This method is called when an access token is validated by the resource server middleware. Return true if the access token has been manually revoked before it expired. If the token is still valid return false.