KNF:SSO notificatie middels een iframe/en: verschil tussen versies

Uit Kennisnet Developers Documentatie
Ga naar: navigatie, zoeken
(Nieuwe pagina aangemaakt met 'The SSO notification cookie can be placed, after the user has logged in on the schoolportal, with an AJAX call to Entree Federatie. For the implementation use the...')
 
(geen verschil)

Huidige versie van 10 jan 2020 om 14:26

The SSO notification cookie can be placed, after the user has logged in on the schoolportal, with an AJAX call to Entree Federatie.

For the implementation use the following script. The following values need te be adjusted: :

  1. eloid: The unique identifier of the Identity Provider as known in Entree Federatie. This is the entity ID of the IdP and can be found here: https://aselect.entree.kennisnet.nl/openaselect/sso/wayfsearch2?type=getAll&spCode
  2. elourl: The URL of the schoolportal where the call comes from.

Important: Before you can use the SSO notification, the URL needs to be added on the whitelist. You can send the URL via an ticket Kennisnet.

<div id="ssonot"></div>

<script type="text/javascript" charset="utf-8">

   var eloid = '';       //EntityId
   var elourl = '';      //ELO URL

   function createCookie(name, value)
   {
      document.cookie = name+"="+value+"; path=/";
   }

   function readCookie(name)
   {
      var nameEQ = name + "=";
      var ca = document.cookie.split(';');
      for(var i=0;i < ca.length;i++) 
      {
         var c = ca[i];
         while (c.charAt(0)==' ')
            c = c.substring(1,c.length);
         if (c.indexOf(nameEQ) == 0)
            return c.substring(nameEQ.length,c.length);
      }
      return null;
   }

   if (readCookie('entreePrelogin') != 'true')
   {
      createCookie('entreePrelogin', 'true');
      document.getElementById('ssonot').innerHTML = '<iframe src="https://ssonot.aselect.entree.kennisnet.nl/openaselect/profiles/entree?id='+eloid+'&url='+encodeURIComponent(elourl)+'">';
   }
</script>