ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
yubikeylogin.php
Go to the documentation of this file.
1 <?php
2 
12 if (!array_key_exists('AuthState', $_REQUEST)) {
13  throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.');
14 }
15 $authStateId = $_REQUEST['AuthState'];
16 
17 if (array_key_exists('otp', $_REQUEST)) {
18  $otp = $_REQUEST['otp'];
19 } else {
20  $otp = '';
21 }
22 
23 if (!empty($otp)) {
24  // attempt to log in
26 } else {
27  $errorCode = NULL;
28 }
29 
31 $t = new SimpleSAML_XHTML_Template($globalConfig, 'authYubiKey:yubikeylogin.php');
32 $t->data['stateparams'] = array('AuthState' => $authStateId);
33 $t->data['errorcode'] = $errorCode;
35 $t->data['logo_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/logo.jpg');
36 $t->data['devicepic_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/yubikey.jpg');
37 $t->show();
38 exit();
$t
$globalConfig
static getAllErrorCodeMessages()
Get a map of both errorcode titles and descriptions.
Definition: ErrorCodes.php:135
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
Create styles array
The data for the language used.
$errorCode
static handleLogin($authStateId, $otp)
Handle login request.
Definition: YubiKey.php:122
if(!array_key_exists('AuthState', $_REQUEST)) $authStateId
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.