Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bill Burke committed 2014-03-12 10:17:24 -04:00
commit e48cc006f6
41 files changed
+370 -130

No files matched your search

@@ -1,25 +1,52 @@
<html>
<head>
<title>Customer View Page</title>
<script src="/auth/js/keycloak.js"></script>
<script src="http://localhost:8081/auth/js/keycloak.js"></script>
</head>
<body bgcolor="#E3F6CE">
<p>Goto: <a href="#" onclick="keycloak.logout()">logout</a></p>
User <b id="username"></b> made this request.
User <b id="subject"></b> made this request.
<p><b>User details (from <span id="profileType"></span>)</b></p>
<p>Username: <span id="username"></span></p>
<p>Email: <span id="email"></span></p>
<p>Full Name: <span id="name"></span></p>
<p>First: <span id="givenName"></span></p>
<p>Last: <span id="familyName"></span></p>
<h2>Customer Listing</h2>
<div id="customers"></div>
<script>
var keycloak = Keycloak({
clientId: 'customer-portal',
clientSecret: 'password',
realm: 'demo',
onload: 'login-required'
});
var loadData = function () {
document.getElementById('username').innerText = keycloak.username;
document.getElementById('subject').innerText = keycloak.subject;
console.debug(keycloak.idToken);
if (keycloak.idToken) {
document.getElementById('profileType').innerText = 'IDToken';
document.getElementById('username').innerText = keycloak.idToken.preferred_username;
document.getElementById('email').innerText = keycloak.idToken.email;
document.getElementById('name').innerText = keycloak.idToken.name;
document.getElementById('givenName').innerText = keycloak.idToken.given_name;
document.getElementById('familyName').innerText = keycloak.idToken.family_name;
} else {
keycloak.loadUserProfile(function() {
document.getElementById('profileType').innerText = 'Account Service';
document.getElementById('username').innerText = keycloak.profile.username;
document.getElementById('email').innerText = keycloak.profile.email;
document.getElementById('name').innerText = keycloak.profile.firstName + ' ' + keycloak.profile.lastName;
document.getElementById('givenName').innerText = keycloak.profile.firstName;
document.getElementById('familyName').innerText = keycloak.profile.lastName;
}, function() {
document.getElementById('profileType').innerText = 'Failed to retrieve user details. Please enable claims or account role';
});
}
var url = 'http://localhost:8080/database/customers';
@@ -50,12 +77,11 @@ User <b id="username"></b> made this request.
};
var reloadData = function () {
keycloak.onValidAccessToken(loadData, loadFailure);
}
keycloak.init(loadData);
keycloak.init(loadData, loadFailure);
</script>
+27
View File
@@ -0,0 +1,27 @@
{
"id": "test",
"realm": "test",
"enabled": true,
"sslNotRequired": true,
"privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=",
"publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
"requiredCredentials": [ "password" ],
"users" : [
{
"username" : "test",
"enabled": true,
"email" : "test-user@localhost",
"credentials" : [
{ "type" : "password",
"value" : "test" }
]
}
],
"applications": [
{
"name": "test",
"enabled": true,
"secret": "password"
}
]
}