Class SimpleID\Protocols\OAuth\Authorization

implements Storable

An OAuth authorisation.

An OAuth authorisation permits an OAuth client to access resources with a specified scope owned by the resource owner. Authorisation codes, access and refresh tokens are issued based on this authorisation.

Within SimpleID, the owner (usually a user, but can sometimes be the client object itself) and the client must be Storable .

Each authorisation in SimpleID contains a randomly generated authorisation state. The authorisation state is stored permanently along with the authorisation. An authorisation state changes when:

  • a new authorisation is requested with a scope that is narrower (but not wider) than the scope stored with the authorisation
  • the user revokes the authorisation
  • a token grant (e.g. authorisation code or refresh token) is consumed
  • a security incident occurs

Authorisation codes, access and refresh tokens are issued based on a particular authorisation state. Therefore, if the authorisation state changes, all of these credentials are automatically revoked.

The authorisation ID is a hash of the client and owner IDs. The fully qualified authorisation ID is the authorisation ID along with the current authorisation state.

Methods
Constants
Properties