SessionResponse
in package
implements
JsonSerializable
One of a user's sessions, as an administrator sees it.
Table of Contents
Interfaces
- JsonSerializable
Properties
- $amr : array<string|int, mixed>
- $authenticatedAt : string
- $createdAt : string
- $expiresAt : string
- $id : string
- $ipAddress : string|null
- $refreshReplayAt : string|null
- $refreshReplayGraceAccepted : int
- $refreshReplayRefused : int
- $refreshReplayVerdict : string
- $userAgent : string|null
Methods
- __construct() : mixed
- Constructs a SessionResponse.
- fromArray() : self
- Rebuilds a SessionResponse from one decoded JSON object.
- jsonSerialize() : array<string, mixed>
- Renders this object for `json_encode()`.
- toArray() : array<string, mixed>
- Renders this object back to its wire form.
Properties
$amr read-only
public
array<string|int, mixed>
$amr
$authenticatedAt read-only
public
string
$authenticatedAt
$createdAt read-only
public
string
$createdAt
$expiresAt read-only
public
string
$expiresAt
$id read-only
public
string
$id
$ipAddress read-only
public
string|null
$ipAddress
= null
$refreshReplayAt read-only
public
string|null
$refreshReplayAt
= null
$refreshReplayGraceAccepted read-only
public
int
$refreshReplayGraceAccepted
$refreshReplayRefused read-only
public
int
$refreshReplayRefused
$refreshReplayVerdict read-only
public
string
$refreshReplayVerdict
$userAgent read-only
public
string|null
$userAgent
= null
Methods
__construct()
Constructs a SessionResponse.
public
__construct(array<int, string> $amr, string $authenticatedAt, string $createdAt, string $expiresAt, string $id, int $refreshReplayGraceAccepted, int $refreshReplayRefused, string $refreshReplayVerdict[, string|null $ipAddress = null ][, string|null $refreshReplayAt = null ][, string|null $userAgent = null ]) : mixed
Parameters
- $amr : array<int, string>
-
RFC 8176 method references for that authentication.
- $authenticatedAt : string
-
X7.2 — when the end user actually authenticated, which is not
created_aton a session produced by refresh rotation. - $createdAt : string
-
the server's
created_atfield - $expiresAt : string
-
the server's
expires_atfield - $id : string
-
the server's
idfield - $refreshReplayGraceAccepted : int
-
T-254 — replays accepted under the FAPI 2.0 §5.3.2.1-9 grace window. Only ever non-zero for a client registered
profile: fapi2. - $refreshReplayRefused : int
-
T-254 — replays refused because there was no window to accept them in. Nothing a conformant client does.
- $refreshReplayVerdict : string
-
T-254 — the badge:
none,fapi_grace_retryorrefused. Derived from the two counters below rather than stored, so it cannot disagree with them. A refusal outranks an accepted grace retry however the counts compare. - $ipAddress : string|null = null
-
the server's
ip_addressfield (optional) - $refreshReplayAt : string|null = null
-
T-254 — when a refresh token of this session was last presented after it had already been rotated.
Noneif that has never happened. (optional) - $userAgent : string|null = null
-
the server's
user_agentfield (optional)
fromArray()
Rebuilds a SessionResponse from one decoded JSON object.
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
-
The raw wire object.
Return values
selfjsonSerialize()
Renders this object for `json_encode()`.
public
jsonSerialize() : array<string, mixed>
Any Sensitive it carries stays WRAPPED here, so a log line or a
json_encode($model) in application code prints [SENSITIVE]. The one place a secret
is revealed is ManagementTransport, on the way to the wire
and nowhere else (§27.5).
Return values
array<string, mixed>toArray()
Renders this object back to its wire form.
public
toArray() : array<string, mixed>
§27.4 rule 5: a null property is OMITTED, not emitted as null. On a sparse update those two say opposite things — "leave this alone" versus "set this to nothing" — and only omission means the first.