Zitadel PHP Client 1.3.6
PHP Client for Zitadel
Loading...
Searching...
No Matches
TOTP Class Reference

Public Member Functions

 __construct (array $settings)
 
 setUserId (int $userid)
 
 getURI ()
 
 getSecret ()
 
 getQRCode ()
 
 start ()
 
 verify ($verifyCode)
 

Detailed Description

Set up a TOTP generator for a user

Definition at line 12 of file TOTP.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array $settings)

Initialize the TOTP setup

Parameters
$settingsarray The settings array

Definition at line 22 of file TOTP.php.

Member Function Documentation

◆ getQRCode()

getQRCode ( )

Get the TOTP QR-Code ready for any Authenticator-App

Returns
string Base64 encoded SVG image url e.g. data:image/svg+xml;base64,PD94...

Definition at line 51 of file TOTP.php.

◆ getSecret()

getSecret ( )

Get the TOTP Secret

Returns
string TOTP secret

Definition at line 44 of file TOTP.php.

◆ getURI()

getURI ( )

Get the TOTP URI

Returns
string TOTP URI

Definition at line 37 of file TOTP.php.

◆ setUserId()

setUserId ( int $userid)

Set the userid

Parameters
$useridint User id
Returns
void

Definition at line 30 of file TOTP.php.

◆ start()

start ( )

Set up a TOTP token for a user. You can get the URI via the getURI() command, the TOTP secret via the getSecret() command or the QR-Code via the getQRCode() command

Returns
void
Exceptions
Exception

Definition at line 61 of file TOTP.php.

◆ verify()

verify ( $verifyCode)

Verify the TOTP method creation. You can only use this function to finish the TOTP setup. To verify the Code after login, use the 'Create' class in 'Session'.

Parameters
$verifyCode
Returns
bool Is the TOTP code correct?

Definition at line 95 of file TOTP.php.


The documentation for this class was generated from the following file: