change uri scheme

This commit is contained in:
Bill Burke 2014-01-13 17:07:36 -05:00
parent 355d4bdf91
commit 39b61728d6
34 changed files with 121 additions and 126 deletions

2
README.md Normal file → Executable file
View File

@ -1,4 +1,4 @@
keycloak
========
SSO SaaS
SSO Service for web apps and REST services.

View File

@ -5,24 +5,24 @@
<meta charset="utf-8">
<title>Keycloak</title>
<link rel="icon" href="/auth-server/admin-ui/img/favicon.ico">
<link rel="icon" href="/auth/admin-ui/img/favicon.ico">
<!-- Frameworks -->
<link rel="stylesheet" href="/auth-server/admin-ui/css/reset.css">
<link rel="stylesheet" href="/auth-server/admin-ui/bootstrap-3.0.0-wip/css/bootstrap.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/sprites.css">
<link rel="stylesheet" href="/auth/admin-ui/css/reset.css">
<link rel="stylesheet" href="/auth/admin-ui/bootstrap-3.0.0-wip/css/bootstrap.css">
<link rel="stylesheet" href="/auth/admin-ui/css/sprites.css">
<link rel="stylesheet" href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic'>
<!-- RCUE styles -->
<link rel="stylesheet" href="/auth-server/admin-ui/css/base.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/forms.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/header.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/tabs.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/icons.css">
<link rel="stylesheet" href="/auth-server/admin-ui/css/tables.css">
<link rel="stylesheet" href="/auth/admin-ui/css/base.css">
<link rel="stylesheet" href="/auth/admin-ui/css/forms.css">
<link rel="stylesheet" href="/auth/admin-ui/css/header.css">
<link rel="stylesheet" href="/auth/admin-ui/css/tabs.css">
<link rel="stylesheet" href="/auth/admin-ui/css/icons.css">
<link rel="stylesheet" href="/auth/admin-ui/css/tables.css">
<!-- Page styles -->
<link rel="stylesheet" href="/auth-server/admin-ui/css/admin-console.css">
<link rel="stylesheet" href="/auth/admin-ui/css/admin-console.css">
<link href="lib/select2-3.4.1/select2.css" rel="stylesheet">
<script src="lib/jquery/jquery-1.10.2.js" type="text/javascript"></script>
@ -36,9 +36,9 @@
<script src="lib/jquery/jquery.idletimeout.js" type="text/javascript"></script>
<script src="lib/angular/select2.js" type="text/javascript"></script>
<script src="lib/fileupload/angular-file-upload.min.js"></script> <!--
<script src="/auth-server/admin-ui/bootstrap-3.0.0-wip/js/dropdown.js"></script>
<script src="/auth-server/admin-ui/bootstrap-3.0.0-wip/js/tooltip.js"></script>
<script src="/auth-server/admin-ui/js/bootstrap-tokenfield.js"></script>
<script src="/auth/admin-ui/bootstrap-3.0.0-wip/js/dropdown.js"></script>
<script src="/auth/admin-ui/bootstrap-3.0.0-wip/js/tooltip.js"></script>
<script src="/auth/admin-ui/js/bootstrap-tokenfield.js"></script>
-->
<script src="js/app.js"></script>
<script src="js/controllers/realm.js"></script>
@ -82,12 +82,12 @@
$.idleTimeout('#idletimeout', '#idletimeout a', {
idleAfter: 300,
pollingInterval: 60,
keepAliveURL: '/auth-server/rest/saas/keepalive',
keepAliveURL: '/auth/rest/admin/keepalive',
serverResponseEquals: '',
failedRequests: 1,
onTimeout: function(){
$(this).slideUp();
window.location = "/auth-server/rest/saas/logout";
window.location = "/auth/rest/admin/logout";
},
onIdle: function(){
$(this).slideDown(); // show the warning bar

View File

@ -5,7 +5,7 @@ var resourceRequests = 0;
var loadingTimer = -1;
angular.element(document).ready(function ($http) {
$http.get('/auth-server/rest/saas/whoami').success(function(data) {
$http.get('/auth/rest/admin/whoami').success(function(data) {
var auth = {};
auth.user = data;
auth.loggedIn = true;
@ -16,7 +16,7 @@ angular.element(document).ready(function ($http) {
angular.bootstrap(document, ["keycloak"]);
}).error(function() {
var path = window.location.hash && window.location.hash.substring(1) || '/';
window.location = '/auth-server/rest/saas/login?path=' + path;
window.location = '/auth/rest/admin/login?path=' + path;
});
});
@ -484,7 +484,7 @@ module.factory('errorInterceptor', function($q, $window, $rootScope, $location,
if (response.status == 401) {
console.log('session timeout?');
Auth.loggedIn = false;
window.location = '/auth-server/rest/saas/login?path=' + $location.path();
window.location = '/auth/rest/admin/login?path=' + $location.path();
} else if (response.status == 404) {
Notifications.error("Not found");
} else if (response.status) {

View File

@ -309,7 +309,7 @@ module.controller('ApplicationScopeMappingCtrl', function($scope, $http, realm,
});
$scope.addRealmRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/realm',
$http.post('/auth/rest/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/realm',
$scope.selectedRealmRoles).success(function() {
for (var i = 0; i < $scope.selectedRealmRoles.length; i++) {
var role = $scope.selectedRealmRoles[i];
@ -324,7 +324,7 @@ module.controller('ApplicationScopeMappingCtrl', function($scope, $http, realm,
};
$scope.deleteRealmRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/realm',
$http.delete('/auth/rest/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/realm',
{data : $scope.selectedRealmMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedRealmMappings.length; i++) {
var role = $scope.selectedRealmMappings[i];
@ -339,7 +339,7 @@ module.controller('ApplicationScopeMappingCtrl', function($scope, $http, realm,
};
$scope.addApplicationRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$http.post('/auth/rest/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$scope.selectedApplicationRoles).success(function() {
for (var i = 0; i < $scope.selectedApplicationRoles.length; i++) {
var role = $scope.selectedApplicationRoles[i];
@ -354,7 +354,7 @@ module.controller('ApplicationScopeMappingCtrl', function($scope, $http, realm,
};
$scope.deleteApplicationRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$http.delete('/auth/rest/admin/realms/' + realm.id + '/applications/' + application.id + '/scope-mappings/applications/' + $scope.targetApp.id,
{data : $scope.selectedApplicationMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedApplicationMappings.length; i++) {
var role = $scope.selectedApplicationMappings[i];

View File

@ -209,7 +209,7 @@ module.controller('OAuthClientScopeMappingCtrl', function($scope, $http, realm,
});
$scope.addRealmRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/realm',
$http.post('/auth/rest/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/realm',
$scope.selectedRealmRoles).success(function() {
for (var i = 0; i < $scope.selectedRealmRoles.length; i++) {
var role = $scope.selectedRealmRoles[i];
@ -224,7 +224,7 @@ module.controller('OAuthClientScopeMappingCtrl', function($scope, $http, realm,
};
$scope.deleteRealmRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/realm',
$http.delete('/auth/rest/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/realm',
{data : $scope.selectedRealmMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedRealmMappings.length; i++) {
var role = $scope.selectedRealmMappings[i];
@ -239,7 +239,7 @@ module.controller('OAuthClientScopeMappingCtrl', function($scope, $http, realm,
};
$scope.addApplicationRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$http.post('/auth/rest/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$scope.selectedApplicationRoles).success(function() {
for (var i = 0; i < $scope.selectedApplicationRoles.length; i++) {
var role = $scope.selectedApplicationRoles[i];
@ -254,7 +254,7 @@ module.controller('OAuthClientScopeMappingCtrl', function($scope, $http, realm,
};
$scope.deleteApplicationRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/applications/' + $scope.targetApp.id,
$http.delete('/auth/rest/admin/realms/' + realm.id + '/oauth-clients/' + oauth.id + '/scope-mappings/applications/' + $scope.targetApp.id,
{data : $scope.selectedApplicationMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedApplicationMappings.length; i++) {
var role = $scope.selectedApplicationMappings[i];

View File

@ -4,7 +4,7 @@ module.controller('GlobalCtrl', function($scope, $http, Auth, Current, $location
};
$scope.auth = Auth;
$http.get('/auth-server/rest/saas/whoami').success(function(data, status) {
$http.get('/auth/rest/admin/whoami').success(function(data, status) {
Auth.user = data;
Auth.loggedIn = true;
})
@ -87,7 +87,7 @@ module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $
for (var i = 0; i < $scope.files.length; i++) {
var $file = $scope.files[i];
$scope.upload = $upload.upload({
url: '/auth-server/rest/saas/admin/realms', //upload.php script, node.js route, or servlet url
url: '/auth/rest/admin/realms', //upload.php script, node.js route, or servlet url
// method: POST or PUT,
// headers: {'headerKey': 'headerValue'}, withCredential: true,
data: {myObj: ""},

View File

@ -30,7 +30,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
});
$scope.addRealmRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/realm',
$http.post('/auth/rest/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/realm',
$scope.selectedRealmRoles).success(function() {
for (var i = 0; i < $scope.selectedRealmRoles.length; i++) {
var role = $scope.selectedRealmRoles[i];
@ -45,7 +45,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
};
$scope.deleteRealmRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/realm',
$http.delete('/auth/rest/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/realm',
{data : $scope.selectedRealmMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedRealmMappings.length; i++) {
var role = $scope.selectedRealmMappings[i];
@ -60,7 +60,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
};
$scope.addApplicationRole = function() {
$http.post('/auth-server/rest/saas/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/applications/' + $scope.application.id,
$http.post('/auth/rest/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/applications/' + $scope.application.id,
$scope.selectedApplicationRoles).success(function() {
for (var i = 0; i < $scope.selectedApplicationRoles.length; i++) {
var role = $scope.selectedApplicationRoles[i];
@ -75,7 +75,7 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
};
$scope.deleteApplicationRole = function() {
$http.delete('/auth-server/rest/saas/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/applications/' + $scope.application.id,
$http.delete('/auth/rest/admin/realms/' + realm.id + '/users/' + user.username + '/role-mappings/applications/' + $scope.application.id,
{data : $scope.selectedApplicationMappings, headers : {"content-type" : "application/json"}}).success(function() {
for (var i = 0; i < $scope.selectedApplicationMappings.length; i++) {
var role = $scope.selectedApplicationMappings[i];

View File

@ -106,7 +106,7 @@ module.factory('Notifications', function($rootScope, $timeout) {
});
module.factory('Realm', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:id', {
return $resource('/auth/rest/admin/realms/:id', {
id : '@id'
}, {
update : {
@ -116,7 +116,7 @@ module.factory('Realm', function($resource) {
});
module.factory('User', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/users/:userId', {
return $resource('/auth/rest/admin/realms/:realm/users/:userId', {
realm : '@realm',
userId : '@userId'
}, {
@ -127,7 +127,7 @@ module.factory('User', function($resource) {
});
module.factory('UserCredentials', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/users/:userId/credentials', {
return $resource('/auth/rest/admin/realms/:realm/users/:userId/credentials', {
realm : '@realm',
userId : '@userId'
}, {
@ -139,14 +139,14 @@ module.factory('UserCredentials', function($resource) {
});
module.factory('RealmRoleMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/users/:userId/role-mappings/realm', {
return $resource('/auth/rest/admin/realms/:realm/users/:userId/role-mappings/realm', {
realm : '@realm',
userId : '@userId'
});
});
module.factory('ApplicationRoleMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/users/:userId/role-mappings/applications/:application', {
return $resource('/auth/rest/admin/realms/:realm/users/:userId/role-mappings/applications/:application', {
realm : '@realm',
userId : '@userId',
application : "@application"
@ -154,14 +154,14 @@ module.factory('ApplicationRoleMapping', function($resource) {
});
module.factory('ApplicationRealmScopeMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/scope-mappings/realm', {
return $resource('/auth/rest/admin/realms/:realm/applications/:application/scope-mappings/realm', {
realm : '@realm',
application : '@application'
});
});
module.factory('ApplicationApplicationScopeMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/scope-mappings/applications/:targetApp', {
return $resource('/auth/rest/admin/realms/:realm/applications/:application/scope-mappings/applications/:targetApp', {
realm : '@realm',
application : '@application',
targetApp : '@targetApp'
@ -171,7 +171,7 @@ module.factory('ApplicationApplicationScopeMapping', function($resource) {
module.factory('RealmRoles', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/roles', {
return $resource('/auth/rest/admin/realms/:realm/roles', {
realm : '@realm'
});
});
@ -179,7 +179,7 @@ module.factory('RealmRoles', function($resource) {
module.factory('Role', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/roles/:roleId', {
return $resource('/auth/rest/admin/realms/:realm/roles/:roleId', {
realm : '@realm',
roleId : '@roleId'
}, {
@ -190,7 +190,7 @@ module.factory('Role', function($resource) {
});
module.factory('ApplicationRole', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/roles/:roleId', {
return $resource('/auth/rest/admin/realms/:realm/applications/:application/roles/:roleId', {
realm : '@realm',
application : "@application",
roleId : '@roleId'
@ -203,7 +203,7 @@ module.factory('ApplicationRole', function($resource) {
module.factory('Application', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:id', {
return $resource('/auth/rest/admin/realms/:realm/applications/:id', {
realm : '@realm',
id : '@id'
}, {
@ -214,8 +214,8 @@ module.factory('Application', function($resource) {
});
module.factory('ApplicationInstallation', function($resource) {
var url = '/auth-server/rest/saas/admin/realms/:realm/applications/:application/installation';
var resource = $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/installation', {
var url = '/auth/rest/admin/realms/:realm/applications/:application/installation';
var resource = $resource('/auth/rest/admin/realms/:realm/applications/:application/installation', {
realm : '@realm',
application : '@application'
}, {
@ -230,7 +230,7 @@ module.factory('ApplicationInstallation', function($resource) {
});
module.factory('ApplicationCredentials', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/credentials', {
return $resource('/auth/rest/admin/realms/:realm/applications/:application/credentials', {
realm : '@realm',
application : '@application'
}, {
@ -242,7 +242,7 @@ module.factory('ApplicationCredentials', function($resource) {
});
module.factory('ApplicationOrigins', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/allowed-origins', {
return $resource('/auth/rest/admin/realms/:realm/applications/:application/allowed-origins', {
realm : '@realm',
application : '@application'
}, {
@ -254,7 +254,7 @@ module.factory('ApplicationOrigins', function($resource) {
});
module.factory('OAuthClient', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:id', {
return $resource('/auth/rest/admin/realms/:realm/oauth-clients/:id', {
realm : '@realm',
id : '@id'
}, {
@ -265,7 +265,7 @@ module.factory('OAuthClient', function($resource) {
});
module.factory('OAuthClientCredentials', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:oauth/credentials', {
return $resource('/auth/rest/admin/realms/:realm/oauth-clients/:oauth/credentials', {
realm : '@realm',
oauth : '@oauth'
}, {
@ -277,14 +277,14 @@ module.factory('OAuthClientCredentials', function($resource) {
});
module.factory('OAuthClientRealmScopeMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:oauth/scope-mappings/realm', {
return $resource('/auth/rest/admin/realms/:realm/oauth-clients/:oauth/scope-mappings/realm', {
realm : '@realm',
oauth : '@oauth'
});
});
module.factory('OAuthClientApplicationScopeMapping', function($resource) {
return $resource('/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:oauth/scope-mappings/applications/:targetApp', {
return $resource('/auth/rest/admin/realms/:realm/oauth-clients/:oauth/scope-mappings/applications/:targetApp', {
realm : '@realm',
oauth : '@oauth',
targetApp : '@targetApp'
@ -292,8 +292,8 @@ module.factory('OAuthClientApplicationScopeMapping', function($resource) {
});
module.factory('OAuthClientInstallation', function($resource) {
var url = '/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:oauth/installation';
var resource = $resource('/auth-server/rest/saas/admin/realms/:realm/oauth-clients/:oauth/installation', {
var url = '/auth/rest/admin/realms/:realm/oauth-clients/:oauth/installation';
var resource = $resource('/auth/rest/admin/realms/:realm/oauth-clients/:oauth/installation', {
realm : '@realm',
oauth : '@oauth'
}, {

View File

@ -3,16 +3,16 @@
<div class="navbar-inner clearfix container">
<h1><a href="#/"><strong>Keycloak</strong> Central Login</a></h1>
<ul class="nav pull-right" data-ng-hide="auth.loggedIn">
<li><a href="/auth-server/rest/saas/login?path={{fragment}}">Login</a></li>
<li><a href="/auth-server/rest/saas/registrations">Register</a></li>
<li><a href="/auth/rest/admin/login?path={{fragment}}">Login</a></li>
<li><a href="/auth/rest/admin/registrations">Register</a></li>
</ul>
<ul class="nav pull-right" data-ng-show="auth.loggedIn">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="icon-user">Icon: user</span>{{auth.user.displayName}}<i class="caret"></i></a>
<ul class="dropdown-menu">
<li><a href="/auth-server/rest/realms/Keycloak Administration/account">Manage Account</a></li>
<li class="separator"><a href="/auth-server/rest/saas/logout">Sign Out</a></li>
<li><a href="/auth/rest/realms/Keycloak Administration/account">Manage Account</a></li>
<li class="separator"><a href="/auth/rest/admin/logout">Sign Out</a></li>
</ul>
</li>
</ul>

View File

@ -55,8 +55,8 @@ keycloak-appliance-dist-all-1.0-alpha-1-SNAPSHOT/
<literal>standalone.bat</literal>
script is used to start the server.
After executing that, log into the admin console at<ulink
url="http://localhost:8080/auth-server/rest/saas/login">
http://localhost:8080/auth-server/rest/saas/login</ulink>.
url="http://localhost:8080/auth/rest/admin/login">
http://localhost:8080/auth/rest/admin/login</ulink>.
Username:
<emphasis>admin</emphasis>
Password:<emphasis>admin</emphasis>. Keycloak with then prompt you to
@ -104,8 +104,8 @@ keycloak-war-dist-all-1.0-alpha-1-SNAPSHOT/
<para>
After booting up the JBoss or Wildfly distro, you can then make sure it is installed properly
by logging into the admin console at<ulink
url="http://localhost:8080/auth-server/rest/saas/login">
http://localhost:8080/auth-server/rest/saas/login</ulink>.
url="http://localhost:8080/auth/rest/admin/login">
http://localhost:8080/auth/rest/admin/login</ulink>.
Username:
<emphasis>admin</emphasis>
Password:<emphasis>admin</emphasis>. Keycloak with then prompt you to

View File

@ -50,7 +50,7 @@ Next thing you have to do is import the test realm for the demo. Clicking on th
create realm page in the admin UI. The username/password is admin/admin to login in. Keycloak will ask you to
create a new password admin password before you can go to the create realm page.
[http://localhost:8080/auth-server/admin/index.html#/create/realm](http://localhost:8080/auth-server/admin/index.html#/create/realm)
[http://localhost:8080/auth/admin/index.html#/create/realm](http://localhost:8080/auth/admin/index.html#/create/realm)
Import the testrealm.json file that is in the as7-eap6-demo/ example directory.
@ -92,7 +92,7 @@ Admin Console
1. Login
Login:
[http://localhost:8080/auth-server/rest/saas/login](http://localhost:8080/auth-server/rest/saas/login)
[http://localhost:8080/auth/rest/admin/login](http://localhost:8080/auth/rest/admin/login)

View File

@ -2,8 +2,8 @@
"realm" : "demo",
"resource" : "customer-portal",
"realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"expose-token" : true,
"credentials" : {

View File

@ -8,9 +8,9 @@
</head>
<body bgcolor="#E3F6CE">
<%
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth-server/rest/realms/demo/tokens/logout")
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout")
.queryParam("redirect_uri", "http://localhost:8080/customer-portal").build().toString();
String acctUri = "http://localhost:8080/auth-server/rest/realms/demo/account";
String acctUri = "http://localhost:8080/auth/rest/realms/demo/account";
%>
<p>Goto: <a href="http://localhost:8080/product-portal">products</a> | <a href="<%=logoutUri%>">logout</a> | <a href="<%=acctUri%>">manage acct</a></p>
User <b><%=request.getUserPrincipal().getName()%></b> made this request.

View File

@ -2,8 +2,8 @@
"realm" : "demo",
"resource" : "product-portal",
"realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -8,9 +8,9 @@
</head>
<body bgcolor="#F5F6CE">
<%
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth-server/rest/realms/demo/tokens/logout")
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout")
.queryParam("redirect_uri", "http://localhost:8080/product-portal").build().toString();
String acctUri = "http://localhost:8080/auth-server/rest/realms/demo/account";
String acctUri = "http://localhost:8080/auth/rest/realms/demo/account";
%>
<p>Goto: <a href="http://localhost:8080/customer-portal">customers</a> | <a href="<%=logoutUri%>">logout</a> | <a href="<%=acctUri%>">manage acct</a></p>

View File

@ -1,7 +1,7 @@
{
"resource" : "third-party",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -1,7 +1,7 @@
{
"resource" : "third-party",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -54,7 +54,7 @@ Next thing you have to do is import the test realm for the demo. Clicking on th
create realm page in the Admin UI. The username/password is admin/admin to login in. Keycloak will ask you to
create a new admin password before you can go to the create realm page.
[http://localhost:8080/auth-server/admin/index.html#/create/realm](http://localhost:8080/auth-server/admin/index.html#/create/realm)
[http://localhost:8080/auth/admin/index.html#/create/realm](http://localhost:8080/auth/admin/index.html#/create/realm)
Import the testrealm.json file that is in the wildfly-demo/ example directory.
@ -93,7 +93,7 @@ an oauth grant page. This page asks you if you want to grant certain permission
Admin Console
==========================
[http://localhost:8080/auth-server/admin/index.html](http://localhost:8080/auth-server/admin/index.html)
[http://localhost:8080/auth/admin/index.html](http://localhost:8080/auth/admin/index.html)

View File

@ -2,8 +2,8 @@
"realm" : "demo",
"resource" : "customer-portal",
"realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"expose-token" : true,
"credentials" : {

View File

@ -8,9 +8,9 @@
</head>
<body bgcolor="#E3F6CE">
<%
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth-server/rest/realms/demo/tokens/logout")
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout")
.queryParam("redirect_uri", "http://localhost:8080/customer-portal").build().toString();
String acctUri = "http://localhost:8080/auth-server/rest/realms/demo/account";
String acctUri = "http://localhost:8080/auth/rest/realms/demo/account";
%>
<p>Goto: <a href="http://localhost:8080/product-portal">products</a> | <a href="<%=logoutUri%>">logout</a> | <a href="<%=acctUri%>">manage acct</a></p>
User <b><%=request.getUserPrincipal().getName()%></b> made this request.

View File

@ -2,8 +2,8 @@
"realm" : "demo",
"resource" : "product-portal",
"realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -8,9 +8,9 @@
</head>
<body bgcolor="#F5F6CE">
<%
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth-server/rest/realms/demo/tokens/logout")
String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth/rest/realms/demo/tokens/logout")
.queryParam("redirect_uri", "http://localhost:8080/product-portal").build().toString();
String acctUri = "http://localhost:8080/auth-server/rest/realms/demo/account";
String acctUri = "http://localhost:8080/auth/rest/realms/demo/account";
%>
<p>Goto: <a href="http://localhost:8080/customer-portal">customers</a> | <a href="<%=logoutUri%>">logout</a> | <a href="<%=acctUri%>">manage acct</a></p>

View File

@ -1,7 +1,7 @@
{
"resource" : "third-party",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -1,7 +1,7 @@
{
"resource" : "third-party",
"auth-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth-server/rest/realms/demo/tokens/access/codes",
"auth-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/login",
"code-url" : "http://localhost:8080/auth/rest/realms/demo/tokens/access/codes",
"ssl-not-required" : true,
"credentials" : {
"password" : "password"

View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<module-name>auth-server</module-name>
<module-name>auth</module-name>
<servlet>
<servlet-name>Resteasy</servlet-name>

2
server/src/main/webapp/index.html Normal file → Executable file
View File

@ -38,7 +38,7 @@
<h3>Your Keycloak is running.</h3>
<p><a href="http://www.keycloak.org/documentation">Documentation</a> | <a href="/auth-server/admin/index.html">Administration Console</a> </p>
<p><a href="http://www.keycloak.org/documentation">Documentation</a> | <a href="/auth/admin/index.html">Administration Console</a> </p>
<p><a href="http://www.keycloak.org">Keycloak Project</a> |
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user">Mailing List</a> |

View File

@ -13,8 +13,8 @@ import org.keycloak.models.UserModel;
import org.keycloak.representations.SkeletonKeyToken;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.services.resources.AccountService;
import org.keycloak.services.resources.AdminService;
import org.keycloak.services.resources.RealmsResource;
import org.keycloak.services.resources.SaasService;
import javax.ws.rs.NotAuthorizedException;
import javax.ws.rs.core.Cookie;
@ -59,8 +59,8 @@ public class AuthenticationManager {
}
public NewCookie createSaasIdentityCookie(RealmModel realm, UserModel user, UriInfo uriInfo) {
String cookieName = SaasService.SAAS_IDENTITY_COOKIE;
URI uri = SaasService.saasCookiePath(uriInfo).build();
String cookieName = AdminService.SAAS_IDENTITY_COOKIE;
URI uri = AdminService.saasCookiePath(uriInfo).build();
String cookiePath = uri.getRawPath();
return createLoginCookie(realm, user, null, cookieName, cookiePath);
}
@ -100,9 +100,9 @@ public class AuthenticationManager {
}
public void expireSaasIdentityCookie(UriInfo uriInfo) {
URI uri = SaasService.saasCookiePath(uriInfo).build();
URI uri = AdminService.saasCookiePath(uriInfo).build();
String cookiePath = uri.getRawPath();
expireCookie(SaasService.SAAS_IDENTITY_COOKIE, cookiePath);
expireCookie(AdminService.SAAS_IDENTITY_COOKIE, cookiePath);
}
public void expireAccountIdentityCookie(URI uri) {
@ -128,7 +128,7 @@ public class AuthenticationManager {
}
public UserModel authenticateSaasIdentityCookie(RealmModel realm, UriInfo uriInfo, HttpHeaders headers) {
String cookieName = SaasService.SAAS_IDENTITY_COOKIE;
String cookieName = AdminService.SAAS_IDENTITY_COOKIE;
Auth auth = authenticateIdentityCookie(realm, uriInfo, headers, cookieName);
return auth != null ? auth.getUser() : null;
}

View File

@ -51,9 +51,9 @@ import java.net.URI;
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
@Path("/saas")
public class SaasService {
protected static final Logger logger = Logger.getLogger(SaasService.class);
@Path("/admin")
public class AdminService {
protected static final Logger logger = Logger.getLogger(AdminService.class);
public static final String REALM_CREATOR_ROLE = "realm-creator";
public static final String SAAS_IDENTITY_COOKIE = "KEYCLOAK_SAAS_IDENTITY";
@ -80,7 +80,7 @@ public class SaasService {
protected AuthenticationManager authManager = new AuthenticationManager();
protected TokenManager tokenManager;
public SaasService(TokenManager tokenManager) {
public AdminService(TokenManager tokenManager) {
this.tokenManager = tokenManager;
}
@ -168,14 +168,14 @@ public class SaasService {
}
public static UriBuilder contextRoot(UriInfo uriInfo) {
return UriBuilder.fromUri(uriInfo.getBaseUri()).replacePath("/auth-server");
return UriBuilder.fromUri(uriInfo.getBaseUri()).replacePath("/auth");
}
public static UriBuilder saasCookiePath(UriInfo uriInfo) {
return contextRoot(uriInfo).path("rest").path(SaasService.class);
return contextRoot(uriInfo).path("rest").path(AdminService.class);
}
@Path("admin/realms")
@Path("realms")
public RealmsAdminResource getRealmsAdmin(@Context final HttpHeaders headers) {
RealmManager realmManager = new RealmManager(session);
RealmModel saasRealm = getAdminstrationRealm(realmManager);
@ -213,7 +213,7 @@ public class SaasService {
logger.debug("authUrl: {0}", authUrl);
oauth.setAuthUrl(authUrl);
oauth.setClientId(Constants.ADMIN_CONSOLE_APPLICATION);
URI redirectUri = uriInfo.getBaseUriBuilder().path(SaasService.class).path(SaasService.class, "loginRedirect").build();
URI redirectUri = uriInfo.getBaseUriBuilder().path(AdminService.class).path(AdminService.class, "loginRedirect").build();
logger.debug("redirectUri: {0}", redirectUri.toString());
oauth.setStateCookiePath(redirectUri.getRawPath());
return oauth.redirect(uriInfo, redirectUri.toString(), path);
@ -317,7 +317,7 @@ public class SaasService {
authManager.expireSaasIdentityCookie(uriInfo);
authManager.expireIdentityCookie(realm, uriInfo);
return Response.status(302).location(uriInfo.getBaseUriBuilder().path(SaasService.class).path(SaasService.class, "loginPage").build()).build();
return Response.status(302).location(uriInfo.getBaseUriBuilder().path(AdminService.class).path(AdminService.class, "loginPage").build()).build();
}
@Path("logout-cookie")

View File

@ -2,13 +2,9 @@ package org.keycloak.services.resources;
import org.jboss.resteasy.logging.Logger;
import org.keycloak.SkeletonKeyContextResolver;
import org.keycloak.models.Constants;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.models.ModelProvider;
import org.keycloak.models.UserModel;
import org.keycloak.services.managers.ApplianceBootstrap;
import org.keycloak.services.managers.RealmManager;
import org.keycloak.services.managers.SocialRequestManager;
import org.keycloak.services.managers.TokenManager;
@ -44,7 +40,7 @@ public class KeycloakApplication extends Application {
TokenManager tokenManager = new TokenManager();
singletons.add(new RealmsResource(tokenManager));
singletons.add(new SaasService(tokenManager));
singletons.add(new AdminService(tokenManager));
singletons.add(new SocialResource(tokenManager, new SocialRequestManager()));
classes.add(SkeletonKeyContextResolver.class);
classes.add(QRCodeResource.class);

View File

@ -10,7 +10,7 @@ import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.services.managers.RealmManager;
import org.keycloak.services.resources.SaasService;
import org.keycloak.services.resources.AdminService;
import org.keycloak.services.resources.flows.Flows;
import javax.ws.rs.*;
@ -19,7 +19,6 @@ import javax.ws.rs.core.CacheControl;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
@ -71,7 +70,7 @@ public class RealmsAdminResource {
}
public static UriBuilder realmsUrl(UriInfo uriInfo) {
return uriInfo.getBaseUriBuilder().path(SaasService.class).path(SaasService.class, "getRealmsAdmin");
return uriInfo.getBaseUriBuilder().path(AdminService.class).path(AdminService.class, "getRealmsAdmin");
}
@POST

View File

@ -22,9 +22,9 @@
package org.keycloak.services.resources.flows;
import org.keycloak.services.resources.AccountService;
import org.keycloak.services.resources.AdminService;
import org.keycloak.services.resources.RealmsResource;
import org.keycloak.services.resources.RequiredActionsService;
import org.keycloak.services.resources.SaasService;
import org.keycloak.services.resources.SocialResource;
import org.keycloak.services.resources.TokenService;
@ -133,23 +133,23 @@ public class Urls {
}
private static UriBuilder saasBase(URI baseUri) {
return UriBuilder.fromUri(baseUri).path(SaasService.class);
return UriBuilder.fromUri(baseUri).path(AdminService.class);
}
public static URI saasLoginAction(URI baseUri) {
return saasBase(baseUri).path(SaasService.class, "processLogin").build();
return saasBase(baseUri).path(AdminService.class, "processLogin").build();
}
public static URI saasLoginPage(URI baseUri) {
return saasBase(baseUri).path(SaasService.class, "loginPage").build();
return saasBase(baseUri).path(AdminService.class, "loginPage").build();
}
public static URI saasRegisterAction(URI baseUri) {
return saasBase(baseUri).path(SaasService.class, "processRegister").build();
return saasBase(baseUri).path(AdminService.class, "processRegister").build();
}
public static URI saasRegisterPage(URI baseUri) {
return saasBase(baseUri).path(SaasService.class, "registerPage").build();
return saasBase(baseUri).path(AdminService.class, "registerPage").build();
}
public static UriBuilder socialBase(URI baseUri) {

View File

@ -250,7 +250,7 @@ public class KeycloakServer {
DeploymentInfo di = server.undertowDeployment(deployment, "rest");
di.setClassLoader(getClass().getClassLoader());
di.setContextPath("/auth-server");
di.setContextPath("/auth");
di.setDeploymentName("Keycloak");
di.setResourceManager(new KeycloakResourceManager(config.getResourcesHome()));
@ -275,7 +275,7 @@ public class KeycloakServer {
info("Loading resources from " + config.getResourcesHome());
}
info("Started Keycloak (http://" + config.getHost() + ":" + config.getPort() + "/auth-server) in "
info("Started Keycloak (http://" + config.getHost() + ":" + config.getPort() + "/auth) in "
+ (System.currentTimeMillis() - start) + " ms\n");
}

View File

@ -55,7 +55,7 @@ public class ApplicationServlet extends HttpServlet {
PrintWriter pw = resp.getWriter();
pw.printf("<html><head><title>%s</title></head><body>", title);
pw.printf(LINK, "http://localhost:8081/auth-server/rest/realms/test/account", "account", "account");
pw.printf(LINK, "http://localhost:8081/auth/rest/realms/test/account", "account", "account");
pw.print("</body></html>");
pw.flush();

View File

@ -26,6 +26,6 @@ package org.keycloak.testsuite;
*/
public class Constants {
public static String AUTH_SERVER_ROOT = "http://localhost:8081/auth-server";
public static String AUTH_SERVER_ROOT = "http://localhost:8081/auth";
}