Skip to content
Snippets Groups Projects
Commit 7df7dbbe authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update headers; add return url

parent d4934a7c
No related branches found
No related tags found
No related merge requests found
# AAI Login page
A login page for multiple AAI organisations.
Its initial focus is on ilias
* PHP 8.x
* PHP
* License: GNU GPL 3.0
* Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
......@@ -20,6 +19,7 @@ This is a standalone login page that offers a list of organisations and can be c
## Requirements
* PHP 8.2
* PHP web aaplication with mod_shibboleth
## Installation
......@@ -34,23 +34,34 @@ First an example configuration:
```php
<?php
return [
'title' => 'AAI Login',
'mode' => 'wayf',
'text-info' => '+++ Hinweis +++ Hinweis +++ Hinweis +++ Hinweis +++',
'text-before-wayf' => '<p>Studierende und Dozenten nutzen in der Regel das nachfolgende "Anmelden":</p>',
'text-after-logins' => '<br><br><h2>Anmeldung ohne AAI</h2>
// -- enable one of it:
'mode' => 'boxes',
// 'mode' => 'wayf',
// -- maintenance hint or other message on top
// 'text-info' => '+++ Hinweis +++ Hinweis +++ Hinweis +++ Hinweis +++',
// -- text before and after
'text-before' => '<p>Studierende und Dozenten nutzen in der Regel das nachfolgende "Anmelden":</p>',
'text-after' => '<br><br><h2>Anmeldung ohne AAI</h2>
<p>
Klicken Sie auf: <br />
<a href="/login.php" onclick="">Gast-Zugang</a>
</p>',
// -- positive list of IDPs
'idps' => [
"https://aai-idp.unibe.ch/idp/shibboleth",
"https://aai.insel.ch/idp/shibboleth",
"https://aai-logon.vho-switchaai.ch/idp/shibboleth",
"https://aai-logon.unibas.ch/idp/shibboleth",
]
],
// -- return URL
'return-url' => '/shib_login.php'
];
```
......@@ -63,6 +74,7 @@ return [
| text-before-wayf | string | Text to show before wayf select box (for mode = "wayf" only)
| text-after-logins | string | Fisnishing text after
| idps | array | List of enabled idps to whitelist; it will filtered by enabled organisatzions by shibboleth
| return-url | string | Return url to your application afer logging in on then organization url<br>- '/shib_login.php' is for Ilias LMS
## Devlopment hints
......
......@@ -19,6 +19,8 @@ return [
"https://aai.insel.ch/idp/shibboleth",
"https://aai-logon.vho-switchaai.ch/idp/shibboleth",
"https://aai-logon.unibas.ch/idp/shibboleth",
]
],
'return-url' => '/shib_login.php'
];
\ No newline at end of file
// ======================================================================
//
// AAI LOGIN WITH SHIBBOLETH HANDLING MULTIPLE ORGANIZATIONS
//
// javascript functions for mode = "boxes"
//
// License: GNU GPL 3.0
// Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
// ======================================================================
// ----------------------------------------------------------------------
......
<?php
// ======================================================================
//
// AAI LOGIN WITH SHIBBOLETH HANDLING MULTIPLE ORGANIZATIONS
//
// included functions
//
// License: GNU GPL 3.0
// Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
// ======================================================================
$SELFURL = isset($_SERVER['SERVER_NAME']) ? "https://" . $_SERVER['SERVER_NAME'] : '';
......@@ -69,7 +78,7 @@ function getIdps()
$sLabel = $aEntry['DisplayNames'][0]['value'] ?? parse_url($sEntityId, PHP_URL_HOST);
$sImage = $aEntry['Logos'][1]['value'] ?? ($aEntry['Logos'][0]['value'] ?? '');
$sUrl = "$SELFURL/Shibboleth.sso/Login?entityID=" . urlencode($sEntityId) . "&target=" . urlencode("$SELFURL/shib_login.php");
$sUrl = "$SELFURL/Shibboleth.sso/Login?entityID=" . urlencode($sEntityId) . "&target=" . urlencode($SELFURL.$aConfig['return-url']??'');
$aReturn[] = [
'label' => $sLabel,
......
<?php
// ======================================================================
//
// AAI LOGIN WITH SHIBBOLETH HANDLING MULTIPLE ORGANIZATIONS
//
// Boxes for all organizations with an input field for filter
//
// License: GNU GPL 3.0
// Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
// ======================================================================
$sOut = '';
// $sOut.='<pre>'.print_r($aIdplist, 1).'</pre>';
......
<?php
// ======================================================================
//
// AAI LOGIN * WAYF
// AAI LOGIN WITH SHIBBOLETH HANDLING MULTIPLE ORGANIZATIONS
//
// Embedded WAYF Script from switch
//
// License: GNU GPL 3.0
// Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
// ======================================================================
?>
......@@ -34,7 +38,7 @@
// URL on this resource that the user shall be returned to after authentication
// Examples: "https://econf.switch.ch/aai/home", "https://olat.uzh.ch/my/courses"
// [Mandatory]
var wayf_return_url = "<?php echo $SELFURL; ?>/shib_login.php";
var wayf_return_url = "<?php echo $SELFURL.$aConfig['return-url']??''; ?>";
//////////////////// RECOMMENDED SETTINGS ////////////////////
......
......@@ -2,18 +2,13 @@
/*
======================================================================
AAI LOGIN FOR ILIAS 9
AAI LOGIN WITH SHIBBOLETH HANDLING MULTIPLE ORGANIZATIONS
----------------------------------------------------------------------
When editing login pages javascript is filtering while saving.
The WAYF script of Switch didn't work anymore.
This script is a workaround and acts as an additional logon page
next to the login.php file.
Institute for Medical Education; University of Bern
GNU GPL 3.0
License: GNU GPL 3.0
Source: https://git-repo.iml.unibe.ch/iml-open-source/login-aai
----------------------------------------------------------------------
2024-09-13 Initial version
======================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment