Changes between Version 2 and Version 3 of Iam2023/Agenda/SP-Installation


Ignore:
Timestamp:
Mar 21, 2023, 12:31:13 PM (14 months ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Iam2023/Agenda/SP-Installation

    v2 v3  
    144144</VirtualHost>
    145145}}}
     146
     147Enable sp site by,
     148{{{
     149a2ensite sp
     150}}}
     151
     152and reload Apache
     153{{{
     154systemctl reload apache2
     155}}}
     156
     157Install Letsencypt and enable https
     158{{{
     159apt install certbot python3-certbot-apache
     160certbot --apache
     161}}}
     162
     163Go through the interactive prompt and include your server details. Make sure you select redirect option when asked.
     164
     165== Configure Shibboleth SP ==
     166
     16711. Download Federation Metadata Signing Certificate:
     168{{{
     169cd /etc/shibboleth/
     170wget https://fr.ac.lk/signedmetadata/metadata-signer -O federation-cert.pem
     171}}}
     172
     17312. Edit shibboleth2.xml opportunely:
     174
     175{{{
     176nano /etc/shibboleth/shibboleth2.xml
     177}}}
     178
     179{{{
     180...
     181<ApplicationDefaults entityID="https://sp.YOUR-DOMAIN/shibboleth"
     182        REMOTE_USER="eppn subject-id pairwise-id persistent-id"
     183        cipherSuites="DEFAULT:!EXP:!LOW:!aNULL:!eNULL:!DES:!IDEA:!SEED:!RC4:!3DES:!kRSA:!SSLv2:!SSLv3:!TLSv1:!TLSv1.1">
     184...
     185<Sessions lifetime="28800" timeout="3600" relayState="ss:mem" checkAddress="false" handlerSSL="true" cookieProps="https">
     186...
     187<SSO discoveryProtocol="SAMLDS" discoveryURL="https://fds.ac.lk">
     188   SAML2
     189</SSO>
     190...
     191<MetadataProvider type="XML" url="https://fr.ac.lk/signedmetadata/metadata.xml" legacyOrgName="true" backingFilePath="test-metadata.xml" maxRefreshDelay="7200">
     192     
     193      <MetadataFilter type="Signature" certificate="federation-cert.pem" verifyBackup="false"/>
     194     
     195      <MetadataFilter type="RequireValidUntil" maxValidityInterval="864000" />
     196</MetadataProvider>
     197<!-- Simple file-based resolvers for separate signing/encryption keys. -->
     198<CredentialResolver type="File" use="signing"
     199      key="sp-signing-key.pem" certificate="sp-signing-cert.pem"/>
     200<CredentialResolver type="File" use="encryption"
     201      key="sp-encrypt-key.pem" certificate="sp-encrypt-cert.pem"/>
     202}}}
     203
     20413. Create SP metadata credentials:
     205{{{
     206
     207    /usr/sbin/shib-keygen -n sp-signing -e https://sp.YOUR-DOMAIN/shibboleth
     208    /usr/sbin/shib-keygen -n sp-encrypt -e https://sp.YOUR-DOMAIN/shibboleth
     209    shibd -t /etc/shibboleth/shibboleth2.xml (Check Shibboleth configuration)
     210
     211}}}
     212
     21314. Enable Shibboleth Apache2 configuration:
     214{{{
     215
     216    a2enmod shib
     217    systemctl reload apache2.service
     218}}}
     219
     22015. Now you are able to reach your Shibboleth SP Metadata on:
     221{{{
     222https://sp.YOUR-DOMAIN/Shibboleth.sso/Metadata (change sp.YOUR-DOMAIN to you SP full qualified domain name)
     223}}}
     224
     22516. Register your SP on LEARN test federation:
     226
     227Go to https://liaf.ac.lk/#join and follow the Service provider registration. Once the federation operator approves your request, you will be asked to use the content of your metadata file on federation registry registration.
     228
     229You may have to answer several questions describing your service to the federation provider.
     230
     231== Configure Moodle as an Federated Resource ==
     232
     233Here as a prerequisite you need a working moodle installation at the path https://sp.YOUR-DOMAIN/moodle. For this please refer to the link [https://ws.learn.ac.lk/wiki/Csle2022/Agenda/databaseandweb, here].
     234
     235
     23617. Create the Apache2 configuration for Moodle:
     237
     238{{{
     239nano /etc/apache2/sites-available/moodle.conf
     240}}}
     241
     242{{{
     243<Location /moodle>
     244        #ShibRequestSetting applicationId mdl
     245</Location>
     246
     247<Directory /var/www/html/moodle/auth/shibboleth/index.php>
     248        AuthType shibboleth
     249        #ShibRequestSetting applicationId mdl
     250        ShibRequireSession On
     251        require valid-user
     252</Directory>
     253}}}
     254
     25518. Then enable the site and restart the apache and shibboleth daemon to make changes to effect.
     256
     257{{{
     258a2ensite secure
     259
     260systemctl restart shibd
     261
     262systemctl restart apache2
     263}}}
     264
     265Now you may browse to https://sp.YOUR-DOMAIN/moodle and select your IDP to log in.