📦 Class \mfaclient

/**
 * 
 * MFA CLIENT CLASS
 * 
 * Connect a web app with MFA server
 * 
 * Source: https://git-repo.iml.unibe.ch/iml-open-source/
 * Docs: https://os-docs.iml.unibe.ch/mfa-client/index.html
 * License: GNU GPL 3.0
 * 
 */

🔶 Properties

(none)

🔷 Methods

🔹 public __construct()

Intialize mfa client - optional set config and user@see setConfig@see setUser

Return: ``

Parameters: 1

Parameter Type Description
<optional> $aConfig array optional: configuration with app id and base url

🔹 public check()

Check MFA server api about user status

Return: array

Parameters: 0

🔹 public debug()

Enable or disable debugging

Return: void

Parameters: 1

Parameter Type Description
<required> $bDebug bool flag: new value for debugging; true = debug enabled

🔹 public ensure()

Check if MFA login is needed and jump to its url

Return: int

Parameters: 0

🔹 public getButtonSetup()

Get an html button to open mfa setup page

Return: string

Parameters: 2

Parameter Type Description
<optional> $sSubmitBtn string optional: html code for a submit button; default: ‘’
<optional> $sBackUrl optional: * optional: url to return from mfa server to the application; default: current url

🔹 public getClientIp()

Get IP of current client (to be sent to MFA server)

Return: string

Parameters: 0

🔹 public getConfig()

return current config

Return: array

Parameters: 0

🔹 public getStatus()

return current status

Return: array

Parameters: 0

🔹 public getUrls()

get list of urls from MFA server

Return: array

Parameters: 0

🔹 public jumpform()

Generate html code for jump form.With it a user can jump from current app to mfa server to setup mfa methods or solve a challenge

Return: string

Parameters: 4

Parameter Type Description
<required> $sUrl string url to jump (mfa server setup page or page to solve challenge)
<optional> $sSubmit string html code for a submit button
<optional> $sBackUrl string url to return from mfa server to the application
<optional> $sFormId string form id

🔹 public loadConfig()

Load configuration file from current directory

Return: void

Parameters: 0

🔹 public logout()

Logout; unset user in session scope

Return: void *

Parameters: 0

🔹 public setConfig()

Apply a given config with app id and base url

Return: void

Parameters: 1

Parameter Type Description
<required> $aConfig array configuration with app id and base url

🔹 public setUser()

Set a user id that is logged in

Return: void *

Parameters: 1

Parameter Type Description
<required> $sUser string user id of current user

🔹 public showHtml()

Show html message and abort to prevent visibility of the app without solved mfa

Return: never *

Parameters: 2

Parameter Type Description
<required> $iHttpStatus int http statuscode to set
<required> $sHtmlcode string http body to show

🔹 public showStatus()

show current status if you want to find out why mfa was skipped@example

txt echo $mfa->showStatus();

Return: string

Parameters: 0


Generated with Axels PHP class doc parser.