Update
in package
Update a session.
First, you have to set the session id and the session token. Then, you can define checks e.g. the Password or TOTP-Codes. If one check fails, the session won't be created. You can also define challenges e.g. an Email-OTP or SMS-OTP. Then, the Zitadel-API will send back the code.
Table of Contents
Properties
- $emailCode : string
- $request : array<string|int, mixed>
- $sessionId : string
- $settings : array<string|int, mixed>
- $smsCode : string
Methods
- __construct() : mixed
- Initialize the Session create setup
- getEmailCode() : string
- Returns the Email-OTP-Code. Works only, if you used the function returnEmailCode() before.
- getSmsCode() : string
- Returns the SMS-OTP-Code. Works only, if you used the function returnSmsCode() before.
- returnEmailCode() : void
- Set the challenge "Email-OTP".
- returnSmsCode() : void
- Set the challenge "SMS-OTP".
- setIdpIntentId() : void
- Set the check "External Identity Providers". You also have to set the IDP-Intent-Token.
- setIdpIntentToken() : void
- Set the check "External Identity Providers". You also have to set the IDP-Intent-ID.
- setLifetime() : void
- Set the session lifetime
- setOtpEmail() : void
- Set the check "Email-OTP".
- setPassword() : void
- Set the check "password".
- setSessionId() : void
- Set the session id (required).
- setSessionToken() : void
- Set the session token (required).
- setSmsCode() : void
- Set the check "SMS-OTP".
- setTOTPCode() : void
- Set the check "TOTP-Code".
- update() : void
- Updates the session
Properties
$emailCode
private
string
$emailCode
$request
private
array<string|int, mixed>
$request
$sessionId
private
string
$sessionId
$settings
private
array<string|int, mixed>
$settings
$smsCode
private
string
$smsCode
Methods
__construct()
Initialize the Session create setup
public
__construct(mixed $settings) : mixed
Parameters
- $settings : mixed
-
array The settings array
getEmailCode()
Returns the Email-OTP-Code. Works only, if you used the function returnEmailCode() before.
public
getEmailCode() : string
Return values
string —The Email-OTP-Code
getSmsCode()
Returns the SMS-OTP-Code. Works only, if you used the function returnSmsCode() before.
public
getSmsCode() : string
Return values
string —The SMS-OTP-Code
returnEmailCode()
Set the challenge "Email-OTP".
public
returnEmailCode() : void
returnSmsCode()
Set the challenge "SMS-OTP".
public
returnSmsCode() : void
setIdpIntentId()
Set the check "External Identity Providers". You also have to set the IDP-Intent-Token.
public
setIdpIntentId(string $idpIntentId) : void
You get the required value from the IDP-class.
Parameters
- $idpIntentId : string
-
The IDP-Intent-ID
setIdpIntentToken()
Set the check "External Identity Providers". You also have to set the IDP-Intent-ID.
public
setIdpIntentToken(string $idpIntentToken) : void
You get the required value from the IDP-class.
Parameters
- $idpIntentToken : string
-
The IDP-Intent-Token
setLifetime()
Set the session lifetime
public
setLifetime(int $seconds) : void
Parameters
- $seconds : int
-
Duration in Seconds after which the session will be automatically invalidated
setOtpEmail()
Set the check "Email-OTP".
public
setOtpEmail(string $otpEmail) : void
Parameters
- $otpEmail : string
-
The Email-Code
setPassword()
Set the check "password".
public
setPassword(string $password) : void
Parameters
- $password : string
-
The user password
setSessionId()
Set the session id (required).
public
setSessionId(string $sessionId) : void
Parameters
- $sessionId : string
-
The session id
setSessionToken()
Set the session token (required).
public
setSessionToken(string $sessionToken) : void
Parameters
- $sessionToken : string
-
The session token
setSmsCode()
Set the check "SMS-OTP".
public
setSmsCode(string $smsCode) : void
Parameters
- $smsCode : string
-
The SMS-Code
setTOTPCode()
Set the check "TOTP-Code".
public
setTOTPCode(string $totpCode) : void
Parameters
- $totpCode : string
-
The TOTP-Code
update()
Updates the session
public
update() : void