OAuth2RBAC

Functional interface that allows users to implement custom RBAC verifiers for OAuth2/OpenId Connect.

Users are to implement the isAuthorized method to verify authorities. For provides that do not export the permissions/roles in the token, this interface allows you to communicate with 3rd party services such as graph APIs to collect the required data.

The contract is that once an authority is checked for a given user, it's value is cached during the execution of the request. If a user is stored to a persistent storage, or the token is introspected, the cache is cleared and a new call will be handled to the implementation.

package

Default

Methods

__construct

__construct() 

This method should verify if the user has the given authority and return either a boolean value or an error.

isAuthorized( $arg0,  $arg1,  $arg2) : void

Note that false and errors are not the same. A user might not have a given authority but that doesn't mean that there was an error during the call.

Arguments

$arg0

AccessToken

$arg1

string

$arg2

callable