Documentation

IntrospectionRequest implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait

Request to Authlete's /api/auth/introspection API.

The API returns information about an access token.

Interfaces, Classes and Traits

ArrayCopyable
Interface to declare instances can be converted into/from arrays.
Arrayable
Interface to declare that instances can be converted into an array.
Jsonable
Interface to declare that instances can be converted into JSON strings.

Table of Contents

copyFromArray()  : mixed
Copy the content of the given array into this object.
copyToArray()  : mixed
Copy the content of this object into the given array.
fromArray()  : static
Convert an array into an instance of this class.
fromJson()  : static
Convert a JSON string into an instance of this class.
getClientCertificate()  : string
Get the client certificate, used to validate binding against access tokens using the MTLS sender confirmation method.
getDpop()  : string
Get the `DPoP` header presented by the client during the request to the resource server. This header contains a signed JWT which includes the public key that is paired with the private key used to sign it.
getHtm()  : string
Get the HTTP method of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.
getHtu()  : string
Get the URL of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.
getScopes()  : array<string|int, string>
Get scopes which are required to access the protected resource endpoint of the resource server.
getSubject()  : string
Get the subject (= unique identifier) of an end-user which is required to access the protected resource endpoint of the resource server.
getToken()  : string
Get the access token.
setClientCertificate()  : IntrospectionRequest
Set the client certificate, used to validate binding against access tokens using the MTLS sender confirmation method.
setDpop()  : IntrospectionRequest
Set the `DPoP` header presented by the client during the request to the resource server. This header contains a signed JWT which includes the public key that is paired with the private key used to sign it.
setHtm()  : IntrospectionRequest
Set the HTTP method of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.
setHtu()  : IntrospectionRequest
Set the URL of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.
setScopes()  : IntrospectionRequest
Set scopes which are required to access the protected resource endpoint of the resource server.
setSubject()  : IntrospectionRequest
Set the subject (= unique identifier) of an end-user which is required to access the protected resource endpoint of the resource server.
setToken()  : IntrospectionRequest
Set the access token.
toArray()  : array<string|int, mixed>
Convert this object into an array.
toJson()  : string
Convert this object into a JSON string.

Methods

copyFromArray()

Copy the content of the given array into this object.

public copyFromArray(array<string|int, mixed> &$array) : mixed
Parameters
$array : array<string|int, mixed>
Return values
mixed

copyToArray()

Copy the content of this object into the given array.

public copyToArray(array<string|int, mixed> &$array) : mixed
Parameters
$array : array<string|int, mixed>
Return values
mixed

fromArray()

Convert an array into an instance of this class.

public static fromArray([array<string|int, mixed> $array = null ]) : static

This static function returns a new instance of this class. If $array is null, null is returned.

Parameters
$array : array<string|int, mixed> = null

An array

Return values
static

An instance of this class.

fromJson()

Convert a JSON string into an instance of this class.

public static fromJson(string $json) : static

This static function returns a new instance of this class. If $json is null or the type of $json is not string, null is returned.

Parameters
$json : string

A JSON string.

Return values
static

An instance of this class.

getClientCertificate()

Get the client certificate, used to validate binding against access tokens using the MTLS sender confirmation method.

public getClientCertificate() : string
Tags
since
1.3
Return values
string

The client certificate in PEM format.

getDpop()

Get the `DPoP` header presented by the client during the request to the resource server. This header contains a signed JWT which includes the public key that is paired with the private key used to sign it.

public getDpop() : string

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Tags
since
1.8
Return values
string

The value of the DPoP header.

getHtm()

Get the HTTP method of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.

public getHtm() : string

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Tags
since
1.8
Return values
string

The HTTP method. For example, GET.

getHtu()

Get the URL of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.

public getHtu() : string

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Tags
since
1.8
Return values
string

The URL of the protected resource endpoint.

getScopes()

Get scopes which are required to access the protected resource endpoint of the resource server.

public getScopes() : array<string|int, string>
Return values
array<string|int, string>

The scopes which are required to access the protected resource endpoint.

getSubject()

Get the subject (= unique identifier) of an end-user which is required to access the protected resource endpoint of the resource server.

public getSubject() : string
Return values
string

The subject which the access token is required to be associated with in order to access the protected resource endpoint.

getToken()

Get the access token.

public getToken() : string
Return values
string

The access token.

setClientCertificate()

Set the client certificate, used to validate binding against access tokens using the MTLS sender confirmation method.

public setClientCertificate(string $certificate) : IntrospectionRequest
Parameters
$certificate : string

The client certificate in PEM format.

Tags
since
1.3
Return values
IntrospectionRequest

$this object.

setDpop()

Set the `DPoP` header presented by the client during the request to the resource server. This header contains a signed JWT which includes the public key that is paired with the private key used to sign it.

public setDpop(string $dpop) : IntrospectionRequest

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Parameters
$dpop : string

The value of the DPoP header.

Tags
since
1.8
Return values
IntrospectionRequest

$this object.

setHtm()

Set the HTTP method of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.

public setHtm(string $htm) : IntrospectionRequest

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Parameters
$htm : string

The HTTP method. For example, GET.

Tags
since
1.8
Return values
IntrospectionRequest

$this object.

setHtu()

Set the URL of the request from the client to the protected resource endpoint. This property is used to validate the `DPoP` header.

public setHtu(string $htu) : IntrospectionRequest

See "OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)" for details.

Parameters
$htu : string

The URL of the protected resource endpoint.

Tags
since
1.8
Return values
IntrospectionRequest

$this object.

setScopes()

Set scopes which are required to access the protected resource endpoint of the resource server.

public setScopes([array<string|int, string> $scopes = null ]) : IntrospectionRequest

If the given array contains one or more scopes which are not covered by the access token, Authlete's /api/auth/introspection API returns IntrospectionAction::FORBIDDEN as the action and sets insufficient_scope as the error code. If null is given, /api/auth/introspection API does not check scopes of the access token.

Parameters
$scopes : array<string|int, string> = null

The scopes which the access token is required to have in order to access the protected resource endpoint.

Return values
IntrospectionRequest

$this object.

setSubject()

Set the subject (= unique identifier) of an end-user which is required to access the protected resource endpoint of the resource server.

public setSubject(string $subject) : IntrospectionRequest

If the specified subject is different from the one associated with the access token, Authlete's /api/auth/introspection API returns IntrospectionAction::FORBIDDEN as the action and sets invalid_request as the error code. If null is given, /api/auth/introspection API does not check the subject of the access token.

Parameters
$subject : string

The subject which the access token is required to be associated with in order to access the protected resource endpoint.

Return values
IntrospectionRequest

$this object.

toArray()

Convert this object into an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array.

toJson()

Convert this object into a JSON string.

public toJson(int $options) : string
Parameters
$options : int

Options passed to json_encode(). This parameter is optional and its default value is 0.

Return values
string

A JSON string.

Search results