WorkOS PHP SDK

AuthenticateResponse
in package
implements JsonSerializable uses JsonSerializableTrait

Read onlyYes

Table of Contents

Interfaces

JsonSerializable

Properties

$accessToken  : string
A JWT containing information about the current session.
$authenticationMethod  : AuthenticateResponseAuthenticationMethod|null
The authentication method used to initiate the session.
$authkitAuthorizationCode  : string|null
An authorization code that can be exchanged for tokens by a different application.
$impersonator  : AuthenticateResponseImpersonator|null
Information about the impersonator if this session was created via impersonation.
$oauthTokens  : AuthenticateResponseOAuthToken|null
The OAuth tokens from the identity provider, if applicable.
$organizationId  : string|null
The ID of the organization the user selected to sign in to.
$refreshToken  : string
[Exchange this token](https://workos.com/docs/reference/authkit/authentication/refresh-token) for a new access token.
$user  : User
The corresponding [user](https://workos.com/docs/reference/authkit/user) object.

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array<string|int, mixed>
toArray()  : array<string|int, mixed>

Properties

$accessToken

A JWT containing information about the current session.

public string $accessToken

$authkitAuthorizationCode

An authorization code that can be exchanged for tokens by a different application.

public string|null $authkitAuthorizationCode = null

$organizationId

The ID of the organization the user selected to sign in to.

public string|null $organizationId = null

$refreshToken

[Exchange this token](https://workos.com/docs/reference/authkit/authentication/refresh-token) for a new access token.

public string $refreshToken

Methods

__construct()

public __construct(User $user, string $accessToken, string $refreshToken[, string|null $organizationId = null ][, string|null $authkitAuthorizationCode = null ][, AuthenticateResponseAuthenticationMethod|null $authenticationMethod = null ][, AuthenticateResponseImpersonator|null $impersonator = null ][, AuthenticateResponseOAuthToken|null $oauthTokens = null ]) : mixed
Parameters
$user : User
$accessToken : string
$refreshToken : string
$organizationId : string|null = null
$authkitAuthorizationCode : string|null = null
$authenticationMethod : AuthenticateResponseAuthenticationMethod|null = null
$impersonator : AuthenticateResponseImpersonator|null = null
$oauthTokens : AuthenticateResponseOAuthToken|null = null

fromArray()

public static fromArray(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

jsonSerialize()

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

toArray()

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

        
On this page

Search results