...
Utökad hantering av errorURL
Se SAML V2.0 Metadata Deployment Profile for errorURL Version 1.0 för definitionen av den utökade hanteringen av errorURL.
...
Shibboleth tillåter ett par macron i templates. Den är dock ganska begränsad och kan kompletteras med javascript. Exempel som hänvisar användaren till identitetsutfärdarens errorURL när autentisering misslyckas, sannolikt på grund av misslyckad MFA-autentisering. Denna gissning bygger på att eventType är Login och att SAML-felkoden är något av AuthnFailed, NoPassive, NoAuthnContext eller NoAuthnContext RequestDenied.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="<shibmlp styleSheet/>" /> <title>Session Error</title> </head> <body> <h1>Ett fel uppstod i sessionen</h1> <shibmlpifnot Meta-errorURL> <p> Kontakta din inloggningstjänst för felsökning. </shibmlpifnot> <shibmlpif Meta-errorURL> <script> var eventtype = '<shibmlp eventType/>'; var statuscode2 = '<shibmlp statusCode2/>'; statuscode2// = statuscode2.replace(/:/g, ":"); var errorurl = "<shibmlp Meta-errorURL />";Replace & #58; with : (shibmlp variables are html-encoded) statuscode2 = statuscode2.replace(/:/g,":"); var nowerrorurl = "<shibmlp now errorURL/>"; var now = "<shibmlp now.replace(/:/g, ":")/>"; var ts = Date.parse(now)/1000; if (eventtype// Replace & #58; with : (shibmlp variables are html-encoded) now = now.replace(/:/g, ":"); var ts = Date.parse(now)/1000; if (errorurl !== null && errorurl !== ''){ if (eventtype === "Login" && ( statuscode2 === "Login" && errorurl && ( urn:oasis:names:tc:SAML:2.0:status:AuthnFailed" || statuscode2 === "urn:oasis:names:tc:SAML:2.0:status:AuthnFailedNoPassive" || statuscode2 === "urn:oasis:names:tc:SAML:2.0:status:NoPassive" || NoAuthnContext" || statuscode2 === "urn:oasis:names:tc:SAML:2.0:status:NoAuthnContextRequestDenied")) { errorurl = errorurl.replace(/ERRORURL_CODE/, "AUTHENTICATION_FAILURE"); errorurl = errorurl.replace(/ERRORURL_TS/, ts); errorurl = errorurl.replace(/ERRORURL_RP/, "<shibmlp target />ERRORURL_RP"); errorurl = errorurl.replace(/ERRORURL_CTX/, "https://refeds.org/profile/mfa"); var errorurl_short = errorurl.replace(/\?.*/, ""); document.write('<p>Er inloggningstjänst tillhandahåller en informationssida som ni uppmanas använda för att lösa detta problem: \ <a href="' + errorurl + '">' + errorurl_short + '</a>.'); } } else { document.write('<p>Kontakta din inloggningstjänst för felsökning.'); } </script> </shibmlpif> <p> Teknisk information: <p><font size="-1"><pre> <shibmlp errorType/> at (<shibmlp requestURL/>) <shibmlp errorText/> <shibmlpif statusCode> Error from identity provider: Status: <shibmlp statusCode/> <shibmlpif statusCode2> Sub-Status: <shibmlp statusCode2/> </shibmlpif> <shibmlpif statusMessage> Message: <shibmlp statusMessage/> </shibmlpif> </shibmlpif> </pre> </body> </html> |
AttributeChecker
AttributeChecker aktiveras i shibboleth.xml. Exempel med krav på attributet norEduPersonNIN:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="<shibmlp styleSheet/>" /> <title>Din identitetsutfärdare skickade ingen identitet</title> </head> <body> <shibmlpif entityID> <h1>Din identitetsutfärdare skickade ingen identitet</h1> Ingen identitet skickades med när du loggade in i Ladok för studenter. Kontakta helpdesk, service desk, IT-support eller motsvarande för er inloggningstjänst för hjälp. <script> var missing_attributes = "<shibmlpifnot norEduPersonNIN>norEduPersonNIN </shibmlpifnot>"; </script> <shibmlpif Meta-errorURL> <p> Er inloggningstjänst tillhandahåller en informationssida som ni uppmanas använda för att lösa detta problem: <script> var errorurl = "<shibmlp Meta-errorURL />"; var now = "<shibmlp now />"; now = now.replace(/:/g, ":"); var ts = Date.parse(now)/1000; if (errorurl) { errorurl = errorurl.replace(/ERRORURL_CODE/, "IDENTIFICATION_FAILURE"); errorurl = errorurl.replace(/ERRORURL_TS/, ts); errorurl = errorurl.replace(/ERRORURL_RP/, "<shibmlp target />"); errorurl = errorurl.replace(/ERRORURL_CTX/, missing_attributes + "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"); var errorurl_short = errorurl.replace(/\?.*/, ""); document.write('<a href="' + errorurl + '">' + errorurl_short + '</a>.'); } </script> </shibmlpif> <p> Teknisk information: <script>document.write(missing_attributes);</script> saknas </shibmlpif> <shibmlpifnot entityID> <h1>Session invalidated</h1> <p>Your session was already invalidated before your information could be examined for completeness.</p> </shibmlpifnot> </body> </html> |
...