Last active
September 11, 2020 05:31
-
-
Save dasniko/d40cda68560beaf816eb106c06290ca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="keycloak.js"></script> | |
</head> | |
<body> | |
<!-- your usual content goes here... --> | |
<script> | |
var keycloak = new Keycloak({ | |
url: 'http://localhost:8080/auth', | |
realm: 'demo', | |
clientId: 'bookBox' | |
}); | |
keycloak.init().then(function(authenticated) { | |
alert(authenticated ? 'authenticated' : 'not authenticated'); | |
}).catch(function (err) { | |
alert('failed to initialize: ' + err); | |
}); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="keycloak.js"></script> | |
<script> | |
var keycloak = new Keycloak({ | |
url: 'http://localhost:8080/auth', | |
realm: 'demo', | |
clientId: 'bookBox' | |
}); | |
function initKc() { | |
keycloak.init().then(function(authenticated) { | |
alert(authenticated ? 'authenticated' : 'not authenticated'); | |
}).catch(function (err) { | |
alert('failed to initialize: ' + err); | |
}); | |
} | |
</script> | |
</head> | |
<body onload="initKc()> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment