OAuth2Auth

Factory interface for creating OAuth2 based @see \io\vertx\jphp\ext\auth\AuthProvider instances.

package

Default

Methods

__construct

__construct() 

Authenticate a user.

authenticate( $arg0,  $arg1) : void

The first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:

  {
    "username": "tim",
    "password": "mypassword"
  }
For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.

If the user is successfully authenticated a object is passed to the handler in an \io.vertx.core.AsyncResult. The user object can then be used for authorisation.

Arguments

$arg0

array

$arg1

callable

Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow.

authorizeURL( $arg0) : string

Arguments

$arg0

array

Response

string

Create a OAuth2 auth provider

create( $arg0,  $arg1 = null,  $arg2 = null) : \io\vertx\jphp\ext\auth\oauth2\OAuth2Auth
static

param $vertx [Vertx] the Vertx instance create($vertx)

Create a OAuth2 auth provider

param $vertx [Vertx] the Vertx instance param $flow [string] this method is deprecated create($vertx, $flow)

Create a OAuth2 auth provider

param $vertx [Vertx] the Vertx instance param $config [OAuth2ClientOptions | array] the config create($vertx, $config)

Create a OAuth2 auth provider

param $vertx [Vertx] the Vertx instance param $flow [string] param $config [OAuth2ClientOptions | array] the config this method is deprecated create($vertx, $flow, $config)

Arguments

$arg0

Vertx

$arg1

string | array | OAuth2ClientOptions

$arg2

array | OAuth2ClientOptions

Response

\io\vertx\jphp\ext\auth\oauth2\OAuth2Auth

the auth provider

createKeycloak

createKeycloak( $arg0,  $arg1,  $arg2) : \io\vertx\jphp\ext\auth\oauth2\OAuth2Auth
static
deprecated

Arguments

$arg0

Vertx

$arg1

string

$arg2

array

Response

\io\vertx\jphp\ext\auth\oauth2\OAuth2Auth

the auth provider

Decode a token to a @see \io\vertx\jphp\ext\auth\oauth2\AccessToken object. This is useful to handle bearer JWT tokens.

decodeToken( $arg0,  $arg1) : $this
deprecated

Arguments

$arg0

string

$arg1

callable

Response

$this

self

Returns the configured flow type for the Oauth2 provider.

getFlowType() : string

Response

string

the flow type.

Returns the scope separator.

getScopeSeparator() : string

The RFC 6749 states that a scope is expressed as a set of case-sensitive and space-delimited strings, however vendors tend not to agree on this and we see the following cases being used: space, plus sign, comma.

deprecated

Response

string

what value was used in the configuration of the object, falling back to the default value which is a space.

Returns the Access Token object.

getToken( $arg0,  $arg1) : void
deprecated

Arguments

$arg0

array

$arg1

callable

Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

introspectToken( $arg0,  $arg1,  $arg2 = null) : $this

param $token [string] the access token (base64 string) param $handler [callable] A handler to receive the event introspectToken($token, $handler)

Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

param $token [string] the access token (base64 string) param $tokenType [string] hint to the token type e.g.: access_token param $handler [callable] A handler to receive the event introspectToken($token, $tokenType, $handler)

Arguments

$arg0

string

$arg1

callable | string

$arg2

callable

Response

$this

self

Loads a JWK Set from the remote provider.

loadJWK( $arg0) : $this

When calling this method several times, the loaded JWKs are updated in the underlying JWT object.

Arguments

$arg0

callable

Response

$this

rbacHandler

rbacHandler( $arg0) : $this

Arguments

$arg0

OAuth2RBAC

Response

$this