25 lines
505 B
HTML
25 lines
505 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="keycloak.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<script>
|
|
keycloak.init({
|
|
clientId : 'test-app',
|
|
clientSecret : 'password',
|
|
baseUrl : 'http://localhost:8081/auth-server',
|
|
realm : 'test',
|
|
redirectUri : 'http://localhost/js'
|
|
});
|
|
|
|
if (keycloak.authenticated) {
|
|
document.write('User: ' + keycloak.user);
|
|
} else {
|
|
document.write('<a href="#" id="login" onclick="keycloak.login(location.hash)">Login</a>');
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|