2013-10-08 16:36:29 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script src="keycloak.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
keycloak.init({
|
|
|
|
clientId : 'test-app',
|
|
|
|
clientSecret : 'password',
|
2013-10-01 13:51:35 +00:00
|
|
|
baseUrl : 'http://localhost:8081/auth-server',
|
2013-10-18 18:15:21 +00:00
|
|
|
realm : 'test',
|
|
|
|
redirectUri : 'http://localhost/js'
|
2013-10-08 16:36:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if (keycloak.authenticated) {
|
|
|
|
document.write('User: ' + keycloak.user);
|
|
|
|
} else {
|
2013-10-19 05:32:09 +00:00
|
|
|
document.write('<a href="#" id="login" onclick="keycloak.login(location.hash)">Login</a>');
|
2013-10-08 16:36:29 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|