Documentation

UserInfoIssueRequest implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait

Request to Authlete's /api/auth/userinfo/issue API.

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.
getClaims()  : string
Get the claims of the subject.
getSub()  : string
Get the value of the "sub" claim.
getToken()  : string
Get the access token contained in the UserInfo request from the client application to the UserInfo endpoint.
setClaims()  : UserInfoIssueRequest
Set the claims of the subject.
setSub()  : UserInfoIssueRequest
Set the value of the "sub" claim.
setToken()  : UserInfoIssueRequest
Set the access token contained in the UserInfo request from the client application to the UserInfo endpoint.
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.

getClaims()

Get the claims of the subject.

public getClaims() : string
Return values
string

The claims of the subject in JSON format.

getSub()

Get the value of the "sub" claim.

public getSub() : string
Return values
string

The value of the sub claim.

getToken()

Get the access token contained in the UserInfo request from the client application to the UserInfo endpoint.

public getToken() : string
Return values
string

The access token contained in the UserInfo request.

setClaims()

Set the claims of the subject.

public setClaims(string $claims) : UserInfoIssueRequest

This request parameter is optional.

The implementation of your service is required to retrieve claims of the subject (= information about the end-user) from its database and format them into JSON.

For example, if given_name claim, family_name claim and email claim are requested, the implementation should generate a JSON object like the following, and then set its string representation by this setClaims() method.

{
  "given_name": "Takahiko",
  "family_name": "Kawasaki",
  "email": "takahiko.kawasaki@example.com"
}

See 5.1. Standard Claims of OpenID Connect Core 1.0 for further details about the format.

Parameters
$claims : string

The claims of the subject in JSON format.

Return values
UserInfoIssueRequest

$this object.

setSub()

Set the value of the "sub" claim.

public setSub(string $sub) : UserInfoIssueRequest

This request parameter is optional.

If a non-empty value is given, it is used as the value of the sub claim. Otherwise, the value of the subject associated with the access token is used.

Parameters
$sub : string

The value of the sub claim.

Return values
UserInfoIssueRequest

$this object.

setToken()

Set the access token contained in the UserInfo request from the client application to the UserInfo endpoint.

public setToken(string $token) : UserInfoIssueRequest
Parameters
$token : string

The access token contained in the UserInfo request.

Return values
UserInfoIssueRequest

$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