Widget: RegistrationButton: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Kiehl (talk | contribs)
(Created page with " <script src="https://idm.safetyid.eu/auth/js/keycloak.js"></script> <script> function initKeycloak() { var keycloak = new Keycloak(); k...")
 
Kiehl (talk | contribs)
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
     <script>
     <script>
         function initKeycloak() {
         function initKeycloak() {
             var keycloak = new Keycloak();
             var keycloak = new Keycloak({
             keycloak.init().then(function(authenticated) {
 
  "realm": "SafetyID",
"clientId": "account-console",
  "auth-server-url": "https://idm.safetyid.eu/auth/",
  "ssl-required": "external",
  "resource": "account-console",
  "public-client": true,
  "confidential-port": 0
 
});
             /*keycloak.init().then(function(authenticated) {
                 alert(authenticated ? 'authenticated' : 'not authenticated');
                 alert(authenticated ? 'authenticated' : 'not authenticated');
             }).catch(function() {
             }).catch(function() {
                alert('failed to initialize');
            });*/
keycloak.init().then().catch(function() {
                 alert('failed to initialize');
                 alert('failed to initialize');
             });
             });
console.log(keycloak.createRegisterUrl())
         }
         }
     </script>
     </script>
</head>
 
<body onload="initKeycloak()">
<script type="text/javascript">
  initKeycloak()
</script>

Latest revision as of 14:08, 7 December 2021

   <script src="https://idm.safetyid.eu/auth/js/keycloak.js"></script>
   <script>
       function initKeycloak() {
           var keycloak = new Keycloak({
 "realm": "SafetyID",

"clientId": "account-console",

 "auth-server-url": "https://idm.safetyid.eu/auth/",
 "ssl-required": "external",
 "resource": "account-console",
 "public-client": true,
 "confidential-port": 0

});

           /*keycloak.init().then(function(authenticated) {
               alert(authenticated ? 'authenticated' : 'not authenticated');
           }).catch(function() {
               alert('failed to initialize');
           });*/

keycloak.init().then().catch(function() {

               alert('failed to initialize');
           });

console.log(keycloak.createRegisterUrl())

       }
   </script>

<script type="text/javascript">

 initKeycloak()

</script>