Changes between Version 2 and Version 3 of SamlSP2021/Agenda/WebappsSso


Ignore:
Timestamp:
Mar 29, 2021, 8:07:25 PM (4 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SamlSP2021/Agenda/WebappsSso

    v2 v3  
    1010* SSL/ HTTPS Certificates issued ( May be using Letsencrypt or Otherwise)
    1111* Installed Wordpress and Moodle latest editions on above created virtual hosts.
    12 * sudo access to the server. All following commands have to be entered as the root user. Best way to do it is login as root by {{{ sudo su }}}
     12* sudo access to the server. All following commands have to be entered as the root user. Best way to do it is, by login in as root with {{{ sudo su }}}
    1313
    1414== Apache Config recap ==
     
    195195* {{{ /usr/sbin/shib-keygen -n mdl-encrypt -e https://mdl.YOUR-DOMAIN/shibboleth }}}
    196196
     197
     198Activate required attributes from  the {{{ /etc/shibboleth/attribute-map.xml }}} For the example, lets uncomment all, but make sure you didnt messed with the file. 
     199
     200
    197201Then check the shibboleth configuration for errors by,
    198202
    199203{{{ shibd -t /etc/shibboleth/shibboleth2.xml }}}
     204
     205
     206=== Enable Shibboleth on apache virtual hosts ===
     207
     208Edit wordpress virtual host as follows:
     209
     210config file:  {{{ /etc/apache2/sites-enabled/wp-le-ssl.conf }}}
     211
     212
     213{{{
     214<IfModule mod_ssl.c>
     215<VirtualHost *:443>
     216       
     217        ServerName wp.Your-Domain
     218        ServerAdmin you@yourwebsite.com
     219        DocumentRoot /var/www/html #Location of Wordpress installation
     220
     221        ErrorLog ${APACHE_LOG_DIR}/wp-error.log
     222        CustomLog ${APACHE_LOG_DIR}/wp-access.log combined
     223
     224        #SSL Certificates issued by letsencrypt
     225        SSLCertificateFile /etc/letsencrypt/live/wp.Your-Domain/fullchain.pem
     226        SSLCertificateKeyFile /etc/letsencrypt/live/wp.Your-Domain/privkey.pem
     227        Include /etc/letsencrypt/options-ssl-apache.conf
     228
     229        <Location />
     230           AuthType Shibboleth
     231           ShibRequestSetting requireSession false #Wordpress shibboleth plugin needs requireSession to be false
     232           Require shibboleth
     233        </Location>
     234
     235</VirtualHost>
     236</IfModule>
     237
     238}}}
     239
     240Edit Moodle virtual host as follows:
     241
     242config file: {{{ /etc/apache2/sites-enabled/mdl-le-ssl.conf }}}
     243
     244
     245{{{
     246<IfModule mod_ssl.c>
     247<VirtualHost *:443>
     248       
     249        ServerName mdl.Your-Domain
     250        ServerAdmin you@yourwebsite.com
     251        DocumentRoot /var/www/mdl #Location of Moodle installation
     252
     253        ErrorLog ${APACHE_LOG_DIR}/mdl-error.log
     254        CustomLog ${APACHE_LOG_DIR}/mdl-access.log combined
     255
     256        #SSL Certificates issued by letsencrypt
     257        SSLCertificateFile /etc/letsencrypt/live/mdl.Your-Domain/fullchain.pem
     258        SSLCertificateKeyFile /etc/letsencrypt/live/mdl.Your-Domain/privkey.pem
     259        Include /etc/letsencrypt/options-ssl-apache.conf
     260
     261        <Location />
     262             ShibRequestSetting applicationId mdl  #Defining shibboleth application override
     263        </Location>
     264
     265
     266        <Directory /var/www/mdl/auth/shibboleth/index.php> #Double Check Moodle installation path
     267             AuthType shibboleth
     268             ShibRequestSetting applicationId mdl
     269             ShibRequireSession On
     270             require valid-user
     271        </Directory>
     272
     273</VirtualHost>
     274</IfModule>
     275}}}
    200276
    201277Next, enable apache shibboleth module and restart apache.
     
    206282    systemctl reload apache2.service
    207283}}}
     284
     285== Register both services with LIAF ==
     286
     287We have now set up shibboleth SP for two different entities. They have to be registered with LIAF before using the Federation discovery Service to point different IDP's.
     288
     289Download the  metadata from both applications by going to the following URL's.
     290
     291* {{{ https://wp.YOUR-DOMAIN/Shibboleth.sso/Metadata }}}
     292* {{{ https://mdl.YOUR-DOMAIN/Shibboleth.sso/Metadata }}}
     293
     294Now register them with LIAF separately.
     295
     296== Enabling Wordpress plugin ==
     297
     298Install and activate the shibboleth plugin by Michael !McNeill, mitcho (Michael 芳貴 Erlewine), Will Norris {{{ https://wordpress.org/plugins/shibboleth/ }}}
     299
     300Then go to '''Settings''' -> '''Shibboleth'''
     301
     302
     303On General Tab:
     304
     305Login URL: {{{ https://wp.YOUR-DOMAIN/Shibboleth.sso/Login }}}
     306
     307Logout URL: {{{ https://wp.YOUR-DOMAIN/Shibboleth.sso/Logout }}}
     308
     309Attribute Access: Environment Variables
     310
     311
     312On User Tab:
     313
     314Tick Automatically Create Accounts.
     315Check the attribute map as well. If you ticked any attribute Manage tick, user will not be able to change the values once they logged in.
     316
     317
     318On Authorization Tab:
     319
     320Select Subscriber as the Default Role.
     321
     322
     323On Logging Tab:
     324
     325Enable all Logging.
     326
     327
     328
     329Click Save.
     330
     331
     332== Enabling Moodle Plugin ==
     333
     334As Moodle admin, go to the '''Site administration''' >>> '''Plugins''' >>> '''Authentication''' and click on the '''Shibboleth''' enable '''eye'''. Next go to its settings.
     335
     336
     337Fill in the fields of the form.
     338
     339The fields 'Username', 'First name', 'Surname', etc. should contain the name of the environment variables of the Shibboleth attributes that you want to map onto the corresponding Moodle variable. Especially the 'Username' field is of great importance because this attribute is used for the Moodle authentication of Shibboleth users.
     340
     341Username: eppn
     342
     343Moodle WAYF service: No
     344
     345Shibboleth Service Provider logout handler URL: /Shibboleth.sso/Logout
     346
     347Data mapping (First name): givenName
     348
     349Data mapping (Surname): surname
     350
     351Data mapping (Email address): mail
     352
     353Update local (Email address): On Creation
     354
     355Lock value (Email address): Locked
     356
     357
     358Click Save.
     359
     360
     361Now using a private browser, try to log in to both systems using your IDP test user.