fed ui
This commit is contained in:
parent
b72a7db6fe
commit
94c06f3f5d
15 changed files with 351 additions and 80 deletions
|
@ -7,6 +7,9 @@ import org.keycloak.models.UserFederationProviderModel;
|
||||||
import org.keycloak.models.KeycloakSession;
|
import org.keycloak.models.KeycloakSession;
|
||||||
import org.picketlink.idm.PartitionManager;
|
import org.picketlink.idm.PartitionManager;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
|
@ -40,4 +43,9 @@ public class LDAPFederationProviderFactory implements UserFederationProviderFact
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return PROVIDER_NAME;
|
return PROVIDER_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getConfigurationOptions() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -711,13 +711,13 @@ module.config([ '$routeProvider', function($routeProvider) {
|
||||||
},
|
},
|
||||||
controller : 'UserFederationCtrl'
|
controller : 'UserFederationCtrl'
|
||||||
})
|
})
|
||||||
.when('/realms/:realm/user-federation/providers/ldap/:provider', {
|
.when('/realms/:realm/user-federation/providers/ldap/:instance', {
|
||||||
templateUrl : 'partials/federated-ldap.html',
|
templateUrl : 'partials/federated-ldap.html',
|
||||||
resolve : {
|
resolve : {
|
||||||
realm : function(RealmLoader) {
|
realm : function(RealmLoader) {
|
||||||
return RealmLoader();
|
return RealmLoader();
|
||||||
},
|
},
|
||||||
provider : function(UserFederationInstanceLoader) {
|
instance : function(UserFederationInstanceLoader) {
|
||||||
return UserFederationInstanceLoader();
|
return UserFederationInstanceLoader();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -729,22 +729,40 @@ module.config([ '$routeProvider', function($routeProvider) {
|
||||||
realm : function(RealmLoader) {
|
realm : function(RealmLoader) {
|
||||||
return RealmLoader();
|
return RealmLoader();
|
||||||
},
|
},
|
||||||
provider : function() {
|
instance : function() {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
controller : 'LDAPCtrl'
|
controller : 'LDAPCtrl'
|
||||||
})
|
})
|
||||||
.when('/create/user-federation/:realm/providers/:provider', {
|
.when('/create/user-federation/:realm/providers/:provider', {
|
||||||
templateUrl : 'partials/federated-ldap.html',
|
templateUrl : 'partials/federated-generic.html',
|
||||||
resolve : {
|
resolve : {
|
||||||
realm : function(RealmLoader) {
|
realm : function(RealmLoader) {
|
||||||
return RealmLoader();
|
return RealmLoader();
|
||||||
},
|
},
|
||||||
provider : function() {
|
instance : function() {
|
||||||
return {
|
return {
|
||||||
providerName: "@provider"
|
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
providerFactory : function(UserFederationFactoryLoader) {
|
||||||
|
return UserFederationFactoryLoader();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
controller : 'GenericUserFederationCtrl'
|
||||||
|
})
|
||||||
|
.when('/realms/:realm/user-federation/providers/:provider/:instance', {
|
||||||
|
templateUrl : 'partials/federated-generic.html',
|
||||||
|
resolve : {
|
||||||
|
realm : function(RealmLoader) {
|
||||||
|
return RealmLoader();
|
||||||
|
},
|
||||||
|
instance : function(UserFederationInstanceLoader) {
|
||||||
|
return UserFederationInstanceLoader();
|
||||||
|
},
|
||||||
|
providerFactory : function(UserFederationFactoryLoader) {
|
||||||
|
return UserFederationFactoryLoader();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
controller : 'GenericUserFederationCtrl'
|
controller : 'GenericUserFederationCtrl'
|
||||||
|
|
|
@ -176,13 +176,23 @@ module.controller('UserListCtrl', function($scope, realm, User) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.controller('UserDetailCtrl', function($scope, realm, user, User, $location, Dialog, Notifications) {
|
module.controller('UserDetailCtrl', function($scope, realm, user, User, UserFederationInstances, $location, Dialog, Notifications) {
|
||||||
$scope.realm = realm;
|
$scope.realm = realm;
|
||||||
$scope.user = angular.copy(user);
|
$scope.user = angular.copy(user);
|
||||||
$scope.create = !user.username;
|
$scope.create = !user.username;
|
||||||
|
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
$scope.user.enabled = true;
|
$scope.user.enabled = true;
|
||||||
|
} else {
|
||||||
|
if(user.federationLink) {
|
||||||
|
console.log("federationLink is not null");
|
||||||
|
UserFederationInstances.get({realm : realm.realm, instance: user.federationLink}, function(link) {
|
||||||
|
$scope.federationLinkName = link.displayName;
|
||||||
|
$scope.federationLink = "#/realms/" + realm.realm + "/user-federation/providers/" + link.providerName + "/" + link.id;
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log("federationLink is null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.changed = false; // $scope.create;
|
$scope.changed = false; // $scope.create;
|
||||||
|
@ -338,24 +348,27 @@ module.controller('UserFederationCtrl', function($scope, $location, realm, UserF
|
||||||
$scope.providers = UserFederationProviders.query({realm: realm.realm});
|
$scope.providers = UserFederationProviders.query({realm: realm.realm});
|
||||||
|
|
||||||
$scope.addProvider = function(provider) {
|
$scope.addProvider = function(provider) {
|
||||||
console.log('Add provider: ' + provider.name);
|
console.log('Add provider: ' + provider.id);
|
||||||
$location.url("/create/user-federation/" + realm.realm + "/providers/" + provider.name);
|
$location.url("/create/user-federation/" + realm.realm + "/providers/" + provider.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.instances = UserFederationInstances.query({realm: realm.realm});
|
$scope.instances = UserFederationInstances.query({realm: realm.realm});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('GenericUserFederationCtrl', function($scope, $location, Notifications, Dialog, realm, provider, providerFactory, UserFederationInstances) {
|
module.controller('GenericUserFederationCtrl', function($scope, $location, Notifications, Dialog, realm, instance, providerFactory, UserFederationInstances) {
|
||||||
console.log('GenericUserFederationCtrl');
|
console.log('GenericUserFederationCtrl');
|
||||||
|
|
||||||
$scope.provider = angular.copy(provider);
|
$scope.instance = angular.copy(instance);
|
||||||
$scope.create = !provider.providerName;
|
$scope.create = !instance.providerName;
|
||||||
|
$scope.providerFactory = providerFactory;
|
||||||
|
|
||||||
|
console.log("providerFactory: " + providerFactory.id);
|
||||||
|
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
$scope.provider.providerName = providerFactory.id;
|
$scope.instance.providerName = providerFactory.id;
|
||||||
$scope.provider.config = {};
|
$scope.instance.config = {};
|
||||||
$scope.provider.priority = 0;
|
$scope.instance.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.realm = realm;
|
$scope.realm = realm;
|
||||||
|
@ -363,8 +376,8 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
|
||||||
|
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
|
|
||||||
$scope.$watch('provider', function() {
|
$scope.$watch('instance', function() {
|
||||||
if (!angular.equals($scope.provider, provider)) {
|
if (!angular.equals($scope.instance, instance)) {
|
||||||
$scope.changed = true;
|
$scope.changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,16 +386,16 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
UserFederationInstances.save({realm: realm.realm}, $scope.provider, function () {
|
UserFederationInstances.save({realm: realm.realm}, $scope.instance, function () {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been created.");
|
Notifications.success("The provider has been created.");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UserFederationInstances.update({realm: realm.realm,
|
UserFederationInstances.update({realm: realm.realm,
|
||||||
provider: provider.id
|
instance: instance.id
|
||||||
},
|
},
|
||||||
$scope.provider, function () {
|
$scope.instance, function () {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been updated.");
|
Notifications.success("The provider has been updated.");
|
||||||
|
@ -392,11 +405,11 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reset = function() {
|
$scope.reset = function() {
|
||||||
$scope.provider = angular.copy(provider);
|
$scope.instance = angular.copy(instance);
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
$scope.provider.providerName = providerFactory.id;
|
$scope.instance.providerName = providerFactory.id;
|
||||||
$scope.provider.config = {};
|
$scope.instance.config = {};
|
||||||
$scope.provider.priority = 0;
|
$scope.instance.priority = 0;
|
||||||
}
|
}
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
};
|
};
|
||||||
|
@ -406,10 +419,10 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.remove = function() {
|
$scope.remove = function() {
|
||||||
Dialog.confirmDelete($scope.provider.id, 'provider', function() {
|
Dialog.confirmDelete($scope.instance.id, 'provider', function() {
|
||||||
$scope.provider.$remove({
|
$scope.instance.$remove({
|
||||||
realm : realm.realm,
|
realm : realm.realm,
|
||||||
provider : $scope.provider.id
|
instance : $scope.instance.id
|
||||||
}, function() {
|
}, function() {
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been deleted.");
|
Notifications.success("The provider has been deleted.");
|
||||||
|
@ -422,16 +435,16 @@ module.controller('GenericUserFederationCtrl', function($scope, $location, Notif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog, realm, provider, UserFederationInstances, RealmLDAPConnectionTester) {
|
module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog, realm, instance, UserFederationInstances, RealmLDAPConnectionTester) {
|
||||||
console.log('LDAPCtrl');
|
console.log('LDAPCtrl');
|
||||||
|
|
||||||
$scope.provider = angular.copy(provider);
|
$scope.instance = angular.copy(instance);
|
||||||
$scope.create = !provider.providerName;
|
$scope.create = !instance.providerName;
|
||||||
|
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
$scope.provider.providerName = "ldap";
|
$scope.instance.providerName = "ldap";
|
||||||
$scope.provider.config = {};
|
$scope.instance.config = {};
|
||||||
$scope.provider.priority = 0;
|
$scope.instance.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.ldapVendors = [
|
$scope.ldapVendors = [
|
||||||
|
@ -449,23 +462,23 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
|
||||||
|
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
|
|
||||||
$scope.lastVendor = $scope.provider.config.vendor;
|
$scope.lastVendor = $scope.instance.config.vendor;
|
||||||
|
|
||||||
$scope.$watch('provider', function() {
|
$scope.$watch('instance', function() {
|
||||||
if (!angular.equals($scope.provider, provider)) {
|
if (!angular.equals($scope.instance, instance)) {
|
||||||
$scope.changed = true;
|
$scope.changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!angular.equals($scope.provider.config.vendor, $scope.lastVendor)) {
|
if (!angular.equals($scope.instance.config.vendor, $scope.lastVendor)) {
|
||||||
console.log("LDAP vendor changed");
|
console.log("LDAP vendor changed");
|
||||||
$scope.lastVendor = $scope.provider.config.vendor;
|
$scope.lastVendor = $scope.instance.config.vendor;
|
||||||
|
|
||||||
if ($scope.lastVendor === "ad") {
|
if ($scope.lastVendor === "ad") {
|
||||||
$scope.provider.config.usernameLDAPAttribute = "cn";
|
$scope.instance.config.usernameLDAPAttribute = "cn";
|
||||||
$scope.provider.config.userObjectClasses = "person, organizationalPerson";
|
$scope.instance.config.userObjectClasses = "person, organizationalPerson";
|
||||||
} else {
|
} else {
|
||||||
$scope.provider.config.usernameLDAPAttribute = "uid";
|
$scope.instance.config.usernameLDAPAttribute = "uid";
|
||||||
$scope.provider.config.userObjectClasses = "inetOrgPerson, organizationalPerson";
|
$scope.instance.config.userObjectClasses = "inetOrgPerson, organizationalPerson";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
@ -473,16 +486,16 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
UserFederationInstances.save({realm: realm.realm}, $scope.provider, function () {
|
UserFederationInstances.save({realm: realm.realm}, $scope.instance, function () {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been created.");
|
Notifications.success("The provider has been created.");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UserFederationInstances.update({realm: realm.realm,
|
UserFederationInstances.update({realm: realm.realm,
|
||||||
provider: provider.id
|
instance: instance.id
|
||||||
},
|
},
|
||||||
$scope.provider, function () {
|
$scope.instance, function () {
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been updated.");
|
Notifications.success("The provider has been updated.");
|
||||||
|
@ -492,14 +505,14 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reset = function() {
|
$scope.reset = function() {
|
||||||
$scope.provider = angular.copy(provider);
|
$scope.instance = angular.copy(instance);
|
||||||
if ($scope.create) {
|
if ($scope.create) {
|
||||||
$scope.provider.providerName = "ldap";
|
$scope.instance.providerName = "ldap";
|
||||||
$scope.provider.config = {};
|
$scope.instance.config = {};
|
||||||
$scope.provider.priority = 0;
|
$scope.instance.priority = 0;
|
||||||
}
|
}
|
||||||
$scope.changed = false;
|
$scope.changed = false;
|
||||||
$scope.lastVendor = $scope.provider.config.vendor;
|
$scope.lastVendor = $scope.instance.config.vendor;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
|
@ -507,10 +520,10 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.remove = function() {
|
$scope.remove = function() {
|
||||||
Dialog.confirmDelete($scope.provider.id, 'provider', function() {
|
Dialog.confirmDelete($scope.instance.id, 'provider', function() {
|
||||||
$scope.provider.$remove({
|
$scope.instance.$remove({
|
||||||
realm : realm.realm,
|
realm : realm.realm,
|
||||||
provider : $scope.provider.id
|
instance : $scope.instance.id
|
||||||
}, function() {
|
}, function() {
|
||||||
$location.url("/realms/" + realm.realm + "/user-federation");
|
$location.url("/realms/" + realm.realm + "/user-federation");
|
||||||
Notifications.success("The provider has been deleted.");
|
Notifications.success("The provider has been deleted.");
|
||||||
|
@ -531,7 +544,7 @@ module.controller('LDAPCtrl', function($scope, $location, Notifications, Dialog,
|
||||||
|
|
||||||
$scope.testConnection = function() {
|
$scope.testConnection = function() {
|
||||||
console.log('LDAPCtrl: testConnection');
|
console.log('LDAPCtrl: testConnection');
|
||||||
RealmLDAPConnectionTester.get(initConnectionTest("testConnection", $scope.provider.config), function() {
|
RealmLDAPConnectionTester.get(initConnectionTest("testConnection", $scope.instance.config), function() {
|
||||||
Notifications.success("LDAP connection successful.");
|
Notifications.success("LDAP connection successful.");
|
||||||
}, function() {
|
}, function() {
|
||||||
Notifications.error("Error when trying to connect to LDAP. See server.log for details.");
|
Notifications.error("Error when trying to connect to LDAP. See server.log for details.");
|
||||||
|
|
|
@ -90,6 +90,15 @@ module.factory('UserLoader', function(Loader, User, $route, $q) {
|
||||||
|
|
||||||
module.factory('UserFederationInstanceLoader', function(Loader, UserFederationInstances, $route, $q) {
|
module.factory('UserFederationInstanceLoader', function(Loader, UserFederationInstances, $route, $q) {
|
||||||
return Loader.get(UserFederationInstances, function() {
|
return Loader.get(UserFederationInstances, function() {
|
||||||
|
return {
|
||||||
|
realm : $route.current.params.realm,
|
||||||
|
instance: $route.current.params.instance
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.factory('UserFederationFactoryLoader', function(Loader, UserFederationProviders, $route, $q) {
|
||||||
|
return Loader.get(UserFederationProviders, function() {
|
||||||
return {
|
return {
|
||||||
realm : $route.current.params.realm,
|
realm : $route.current.params.realm,
|
||||||
provider: $route.current.params.provider
|
provider: $route.current.params.provider
|
||||||
|
|
|
@ -200,9 +200,9 @@ module.factory('User', function($resource) {
|
||||||
});
|
});
|
||||||
|
|
||||||
module.factory('UserFederationInstances', function($resource) {
|
module.factory('UserFederationInstances', function($resource) {
|
||||||
return $resource(authUrl + '/admin/realms/:realm/user-federation/instances/:provider', {
|
return $resource(authUrl + '/admin/realms/:realm/user-federation/instances/:instance', {
|
||||||
realm : '@realm',
|
realm : '@realm',
|
||||||
provider : '@provider'
|
instance : '@instance'
|
||||||
}, {
|
}, {
|
||||||
update : {
|
update : {
|
||||||
method : 'PUT'
|
method : 'PUT'
|
||||||
|
@ -211,8 +211,9 @@ module.factory('UserFederationInstances', function($resource) {
|
||||||
});
|
});
|
||||||
|
|
||||||
module.factory('UserFederationProviders', function($resource) {
|
module.factory('UserFederationProviders', function($resource) {
|
||||||
return $resource(authUrl + '/admin/realms/:realm/user-federation/providers', {
|
return $resource(authUrl + '/admin/realms/:realm/user-federation/providers/:provider', {
|
||||||
realm : '@realm'
|
realm : '@realm',
|
||||||
|
provider : "@provider"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,48 @@
|
||||||
</ol>
|
</ol>
|
||||||
<h2 class="pull-left"><span>{{realm.realm}}</span> Provider Settings</h2>
|
<h2 class="pull-left"><span>{{realm.realm}}</span> Provider Settings</h2>
|
||||||
<p class="subtitle"><span class="required">*</span> Required fields</p>
|
<p class="subtitle"><span class="required">*</span> Required fields</p>
|
||||||
|
<form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><span class="text">Required Settings</span></legend>
|
||||||
|
<div class="form-group clearfix" data-ng-show="!create">
|
||||||
|
<label class="col-sm-2 control-label" for="providerId">Provider ID </label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input class="form-control" id="providerId" type="text" ng-model="instance.id" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group clearfix">
|
||||||
|
<label class="col-sm-2 control-label" for="consoleDisplayName">Console display name </label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input class="form-control" id="consoleDisplayName" type="text" ng-model="instance.displayName" placeholder="defaults to id">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group clearfix">
|
||||||
|
<label class="col-sm-2 control-label" for="priority">Priority </label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input class="form-control" id="priority" type="text" ng-model="instance.priority">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div data-ng-repeat="option in providerFactory.options" class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">{{option|capitalize}} </label>
|
||||||
|
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input class="form-control" type="text" data-ng-model="instance.config[ option ]" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="pull-right form-actions" data-ng-show="create && access.manageUsers">
|
||||||
|
<button kc-cancel data-ng-click="cancel()">Cancel</button>
|
||||||
|
<button kc-save data-ng-show="changed">Save</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-right form-actions" data-ng-show="!create && access.manageUsers">
|
||||||
|
<button kc-reset data-ng-show="changed">Clear changes</button>
|
||||||
|
<button kc-save data-ng-show="changed">Save</button>
|
||||||
|
<button kc-delete data-ng-click="remove()" data-ng-hide="changed">Delete</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -15,16 +15,22 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><span class="text">Required Settings</span></legend>
|
<legend><span class="text">Required Settings</span></legend>
|
||||||
|
<div class="form-group clearfix" data-ng-show="!create">
|
||||||
|
<label class="col-sm-2 control-label" for="providerId">Provider ID </label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input class="form-control" id="providerId" type="text" ng-model="instance.id" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="consoleDisplayName">Console display name </label>
|
<label class="col-sm-2 control-label" for="consoleDisplayName">Console display name </label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="consoleDisplayName" type="text" ng-model="provider.displayName" placeholder="defaults to id">
|
<input class="form-control" id="consoleDisplayName" type="text" ng-model="instance.displayName" placeholder="defaults to id">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="priority">Priority </label>
|
<label class="col-sm-2 control-label" for="priority">Priority </label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="priority" type="text" ng-model="provider.priority">
|
<input class="form-control" id="priority" type="text" ng-model="instance.priority">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
|
@ -32,7 +38,7 @@
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<div class="select-kc">
|
<div class="select-kc">
|
||||||
<select id="vendor"
|
<select id="vendor"
|
||||||
ng-model="provider.config.vendor"
|
ng-model="instance.config.vendor"
|
||||||
ng-options="vendor.id as vendor.name for vendor in ldapVendors">
|
ng-options="vendor.id as vendor.name for vendor in ldapVendors">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +49,7 @@
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<div class="select-kc">
|
<div class="select-kc">
|
||||||
<select id="usernameLDAPAttribute"
|
<select id="usernameLDAPAttribute"
|
||||||
ng-model="provider.config.usernameLDAPAttribute"
|
ng-model="instance.config.usernameLDAPAttribute"
|
||||||
ng-options="usernameLDAPAttribute for usernameLDAPAttribute in usernameLDAPAttributes">
|
ng-options="usernameLDAPAttribute for usernameLDAPAttribute in usernameLDAPAttributes">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,13 +58,13 @@
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="userObjectClasses">User Object Classes </label>
|
<label class="col-sm-2 control-label" for="userObjectClasses">User Object Classes </label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="userObjectClasses" type="text" ng-model="provider.config.userObjectClasses" placeholder="LDAP User Object Classes (div. by comma)">
|
<input class="form-control" id="userObjectClasses" type="text" ng-model="instance.config.userObjectClasses" placeholder="LDAP User Object Classes (div. by comma)">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="ldapConnectionUrl">Connection URL <span class="required">*</span></label>
|
<label class="col-sm-2 control-label" for="ldapConnectionUrl">Connection URL <span class="required">*</span></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="ldapConnectionUrl" type="text" ng-model="provider.config.connectionUrl" placeholder="LDAP connection URL" required>
|
<input class="form-control" id="ldapConnectionUrl" type="text" ng-model="instance.config.connectionUrl" placeholder="LDAP connection URL" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4" data-ng-show="access.manageRealm">
|
<div class="col-sm-4" data-ng-show="access.manageRealm">
|
||||||
<a class="btn btn-primary" data-ng-click="testConnection()">Test connection</a>
|
<a class="btn btn-primary" data-ng-click="testConnection()">Test connection</a>
|
||||||
|
@ -67,25 +73,25 @@
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="ldapBaseDn">Base DN <span class="required">*</span></label>
|
<label class="col-sm-2 control-label" for="ldapBaseDn">Base DN <span class="required">*</span></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="ldapBaseDn" type="text" ng-model="provider.config.baseDn" placeholder="LDAP Base DN" required>
|
<input class="form-control" id="ldapBaseDn" type="text" ng-model="instance.config.baseDn" placeholder="LDAP Base DN" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="ldapUserDnSuffix">User DN Suffix <span class="required">*</span></label>
|
<label class="col-sm-2 control-label" for="ldapUserDnSuffix">User DN Suffix <span class="required">*</span></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="ldapUserDnSuffix" type="text" ng-model="provider.config.userDnSuffix" placeholder="LDAP User DN Suffix" required>
|
<input class="form-control" id="ldapUserDnSuffix" type="text" ng-model="instance.config.userDnSuffix" placeholder="LDAP User DN Suffix" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="ldapBindDn">Bind DN <span class="required">*</span></label>
|
<label class="col-sm-2 control-label" for="ldapBindDn">Bind DN <span class="required">*</span></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="ldapBindDn" type="text" ng-model="provider.config.bindDn" placeholder="LDAP Bind DN" required>
|
<input class="form-control" id="ldapBindDn" type="text" ng-model="instance.config.bindDn" placeholder="LDAP Bind DN" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<label class="col-sm-2 control-label" for="ldapBindCredential">Bind Credential <span class="required">*</span></label>
|
<label class="col-sm-2 control-label" for="ldapBindCredential">Bind Credential <span class="required">*</span></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<input class="form-control" id="ldapBindCredential" type="text" ng-model="provider.config.bindCredential" placeholder="LDAP Bind Credentials" required>
|
<input class="form-control" id="ldapBindCredential" type="text" ng-model="instance.config.bindCredential" placeholder="LDAP Bind Credentials" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4" data-ng-show="access.manageRealm">
|
<div class="col-sm-4" data-ng-show="access.manageRealm">
|
||||||
<a class="btn btn-primary" data-ng-click="testAuthentication()">Test authentication</a>
|
<a class="btn btn-primary" data-ng-click="testAuthentication()">Test authentication</a>
|
||||||
|
|
|
@ -75,6 +75,12 @@
|
||||||
<input ng-model="user.enabled" name="userEnabled" id="userEnabled" onoffswitch />
|
<input ng-model="user.enabled" name="userEnabled" id="userEnabled" onoffswitch />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group clearfix block" data-ng-show="!create && user.federationLink">
|
||||||
|
<label class="col-sm-2 control-label" for="userEnabled">Federation Link</label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<a href="{{federationLink}}">{{federationLinkName}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group clearfix block">
|
<div class="form-group clearfix block">
|
||||||
<label class="col-sm-2 control-label" for="emailVerified">Email verified</label>
|
<label class="col-sm-2 control-label" for="emailVerified">Email verified</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="select-kc">
|
<div class="select-kc">
|
||||||
<select ng-model="selectedProvider"
|
<select ng-model="selectedProvider"
|
||||||
ng-options="p.name for p in providers"
|
ng-options="p.id for p in providers"
|
||||||
data-ng-change="addProvider(selectedProvider); selectedProvider = null">
|
data-ng-change="addProvider(selectedProvider); selectedProvider = null">
|
||||||
<option value="" disabled selected>Add provider...</option>
|
<option value="" disabled selected>Add provider...</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -2,10 +2,13 @@ package org.keycloak.models;
|
||||||
|
|
||||||
import org.keycloak.provider.ProviderFactory;
|
import org.keycloak.provider.ProviderFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public interface UserFederationProviderFactory extends ProviderFactory<UserFederationProvider> {
|
public interface UserFederationProviderFactory extends ProviderFactory<UserFederationProvider> {
|
||||||
UserFederationProvider getInstance(KeycloakSession session, UserFederationProviderModel model);
|
UserFederationProvider getInstance(KeycloakSession session, UserFederationProviderModel model);
|
||||||
|
List<String> getConfigurationOptions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class ModelToRepresentation {
|
||||||
rep.setEnabled(user.isEnabled());
|
rep.setEnabled(user.isEnabled());
|
||||||
rep.setEmailVerified(user.isEmailVerified());
|
rep.setEmailVerified(user.isEmailVerified());
|
||||||
rep.setTotp(user.isTotp());
|
rep.setTotp(user.isTotp());
|
||||||
|
rep.setFederationLink(user.getFederationLink());
|
||||||
|
|
||||||
List<String> reqActions = new ArrayList<String>();
|
List<String> reqActions = new ArrayList<String>();
|
||||||
for (UserModel.RequiredAction ra : user.getRequiredActions()){
|
for (UserModel.RequiredAction ra : user.getRequiredActions()){
|
||||||
|
|
|
@ -16,8 +16,10 @@ import org.keycloak.models.RoleModel;
|
||||||
import org.keycloak.models.SocialLinkModel;
|
import org.keycloak.models.SocialLinkModel;
|
||||||
import org.keycloak.models.UserCredentialModel;
|
import org.keycloak.models.UserCredentialModel;
|
||||||
import org.keycloak.models.UserFederationProvider;
|
import org.keycloak.models.UserFederationProvider;
|
||||||
|
import org.keycloak.models.UserFederationProviderFactory;
|
||||||
import org.keycloak.models.UserFederationProviderModel;
|
import org.keycloak.models.UserFederationProviderModel;
|
||||||
import org.keycloak.models.UserModel;
|
import org.keycloak.models.UserModel;
|
||||||
|
import org.keycloak.models.UserProviderFactory;
|
||||||
import org.keycloak.models.UserSessionModel;
|
import org.keycloak.models.UserSessionModel;
|
||||||
import org.keycloak.models.utils.ModelToRepresentation;
|
import org.keycloak.models.utils.ModelToRepresentation;
|
||||||
import org.keycloak.models.utils.RepresentationToModel;
|
import org.keycloak.models.utils.RepresentationToModel;
|
||||||
|
@ -28,6 +30,7 @@ import org.keycloak.representations.idm.CredentialRepresentation;
|
||||||
import org.keycloak.representations.idm.MappingsRepresentation;
|
import org.keycloak.representations.idm.MappingsRepresentation;
|
||||||
import org.keycloak.representations.idm.RoleRepresentation;
|
import org.keycloak.representations.idm.RoleRepresentation;
|
||||||
import org.keycloak.representations.idm.SocialLinkRepresentation;
|
import org.keycloak.representations.idm.SocialLinkRepresentation;
|
||||||
|
import org.keycloak.representations.idm.UserFederationProviderFactoryRepresentation;
|
||||||
import org.keycloak.representations.idm.UserFederationProviderRepresentation;
|
import org.keycloak.representations.idm.UserFederationProviderRepresentation;
|
||||||
import org.keycloak.representations.idm.UserRepresentation;
|
import org.keycloak.representations.idm.UserRepresentation;
|
||||||
import org.keycloak.representations.idm.UserSessionRepresentation;
|
import org.keycloak.representations.idm.UserSessionRepresentation;
|
||||||
|
@ -96,19 +99,43 @@ public class UserFederationResource {
|
||||||
@GET
|
@GET
|
||||||
@Path("providers")
|
@Path("providers")
|
||||||
@Produces("application/json")
|
@Produces("application/json")
|
||||||
public List<Map<String, String>> getProviders() {
|
public List<UserFederationProviderFactoryRepresentation> getProviders() {
|
||||||
logger.info("get provider list");
|
logger.info("get provider list");
|
||||||
auth.requireView();
|
auth.requireView();
|
||||||
List<Map<String, String>> providers = new LinkedList<Map<String, String>>();
|
List<UserFederationProviderFactoryRepresentation> providers = new LinkedList<UserFederationProviderFactoryRepresentation>();
|
||||||
for (ProviderFactory factory : session.getKeycloakSessionFactory().getProviderFactories(UserFederationProvider.class)) {
|
for (ProviderFactory factory : session.getKeycloakSessionFactory().getProviderFactories(UserFederationProvider.class)) {
|
||||||
Map<String, String> provider = new HashMap<String, String>();
|
UserFederationProviderFactoryRepresentation rep = new UserFederationProviderFactoryRepresentation();
|
||||||
provider.put("name", factory.getId());
|
rep.setId(factory.getId());
|
||||||
providers.add(provider);
|
rep.setOptions(((UserFederationProviderFactory)factory).getConfigurationOptions());
|
||||||
|
providers.add(rep);
|
||||||
}
|
}
|
||||||
logger.info("provider list.size() " + providers.size());
|
logger.info("provider list.size() " + providers.size());
|
||||||
return providers;
|
return providers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get List of available provider factories
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("providers/{id}")
|
||||||
|
@Produces("application/json")
|
||||||
|
public UserFederationProviderFactoryRepresentation getProvider(@PathParam("id") String id) {
|
||||||
|
logger.info("get provider list");
|
||||||
|
auth.requireView();
|
||||||
|
for (ProviderFactory factory : session.getKeycloakSessionFactory().getProviderFactories(UserFederationProvider.class)) {
|
||||||
|
if (!factory.getId().equals(id)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
UserFederationProviderFactoryRepresentation rep = new UserFederationProviderFactoryRepresentation();
|
||||||
|
rep.setId(factory.getId());
|
||||||
|
rep.setOptions(((UserFederationProviderFactory)factory).getConfigurationOptions());
|
||||||
|
return rep;
|
||||||
|
}
|
||||||
|
throw new NotFoundException("Could not find provider");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a provider
|
* Create a provider
|
||||||
*
|
*
|
||||||
|
@ -118,7 +145,7 @@ public class UserFederationResource {
|
||||||
@POST
|
@POST
|
||||||
@Path("instances")
|
@Path("instances")
|
||||||
@Consumes("application/json")
|
@Consumes("application/json")
|
||||||
public Response createProvider(UserFederationProviderRepresentation rep) {
|
public Response createProviderInstance(UserFederationProviderRepresentation rep) {
|
||||||
logger.info("createProvider");
|
logger.info("createProvider");
|
||||||
auth.requireManage();
|
auth.requireManage();
|
||||||
String displayName = rep.getDisplayName();
|
String displayName = rep.getDisplayName();
|
||||||
|
@ -138,7 +165,7 @@ public class UserFederationResource {
|
||||||
@PUT
|
@PUT
|
||||||
@Path("instances/{id}")
|
@Path("instances/{id}")
|
||||||
@Consumes("application/json")
|
@Consumes("application/json")
|
||||||
public void updateProvider(@PathParam("id") String id, UserFederationProviderRepresentation rep) {
|
public void updateProviderInstance(@PathParam("id") String id, UserFederationProviderRepresentation rep) {
|
||||||
logger.info("updateProvider");
|
logger.info("updateProvider");
|
||||||
auth.requireManage();
|
auth.requireManage();
|
||||||
String displayName = rep.getDisplayName();
|
String displayName = rep.getDisplayName();
|
||||||
|
@ -157,7 +184,7 @@ public class UserFederationResource {
|
||||||
@GET
|
@GET
|
||||||
@Path("instances/{id}")
|
@Path("instances/{id}")
|
||||||
@Consumes("application/json")
|
@Consumes("application/json")
|
||||||
public UserFederationProviderRepresentation getProvider(@PathParam("id") String id) {
|
public UserFederationProviderRepresentation getProviderInstance(@PathParam("id") String id) {
|
||||||
logger.info("getProvider");
|
logger.info("getProvider");
|
||||||
auth.requireView();
|
auth.requireView();
|
||||||
for (UserFederationProviderModel model : realm.getUserFederationProviders()) {
|
for (UserFederationProviderModel model : realm.getUserFederationProviders()) {
|
||||||
|
@ -175,7 +202,7 @@ public class UserFederationResource {
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("instances/{id}")
|
@Path("instances/{id}")
|
||||||
public void deleteProvider(@PathParam("id") String id) {
|
public void deleteProviderInstance(@PathParam("id") String id) {
|
||||||
logger.info("deleteProvider");
|
logger.info("deleteProvider");
|
||||||
auth.requireManage();
|
auth.requireManage();
|
||||||
UserFederationProviderModel model = new UserFederationProviderModel(id, null, null, -1, null);
|
UserFederationProviderModel model = new UserFederationProviderModel(id, null, null, -1, null);
|
||||||
|
@ -192,8 +219,8 @@ public class UserFederationResource {
|
||||||
@GET
|
@GET
|
||||||
@Path("instances")
|
@Path("instances")
|
||||||
@Produces("application/json")
|
@Produces("application/json")
|
||||||
public List<UserFederationProviderRepresentation> getUserFederationProviders() {
|
public List<UserFederationProviderRepresentation> getUserFederationInstances() {
|
||||||
logger.info("getUserFederationProviders");
|
logger.info("getUserFederationInstances");
|
||||||
auth.requireManage();
|
auth.requireManage();
|
||||||
List<UserFederationProviderRepresentation> reps = new LinkedList<UserFederationProviderRepresentation>();
|
List<UserFederationProviderRepresentation> reps = new LinkedList<UserFederationProviderRepresentation>();
|
||||||
for (UserFederationProviderModel model : realm.getUserFederationProviders()) {
|
for (UserFederationProviderModel model : realm.getUserFederationProviders()) {
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package org.keycloak.testutils;
|
||||||
|
|
||||||
|
import org.keycloak.models.RealmModel;
|
||||||
|
import org.keycloak.models.RoleModel;
|
||||||
|
import org.keycloak.models.UserCredentialModel;
|
||||||
|
import org.keycloak.models.UserFederationProvider;
|
||||||
|
import org.keycloak.models.UserModel;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
|
* @version $Revision: 1 $
|
||||||
|
*/
|
||||||
|
public class DummyUserFederationProvider implements UserFederationProvider {
|
||||||
|
@Override
|
||||||
|
public UserModel proxy(UserModel local) {
|
||||||
|
return local;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRegistrationSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserModel register(RealmModel realm, UserModel user) {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeUser(RealmModel realm, UserModel user) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserModel getUserByUsername(RealmModel realm, String username) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserModel getUserByEmail(RealmModel realm, String email) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preRemove(RealmModel realm) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preRemove(RealmModel realm, RoleModel role) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(UserModel local) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<String> getSupportedCredentialTypes() {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validCredentials(RealmModel realm, UserModel user, List<UserCredentialModel> input) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validCredentials(RealmModel realm, UserModel user, UserCredentialModel... input) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package org.keycloak.testutils;
|
||||||
|
|
||||||
|
import org.keycloak.Config;
|
||||||
|
import org.keycloak.models.KeycloakSession;
|
||||||
|
import org.keycloak.models.UserFederationProvider;
|
||||||
|
import org.keycloak.models.UserFederationProviderFactory;
|
||||||
|
import org.keycloak.models.UserFederationProviderModel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
|
* @version $Revision: 1 $
|
||||||
|
*/
|
||||||
|
public class DummyUserFederationProviderFactory implements UserFederationProviderFactory {
|
||||||
|
@Override
|
||||||
|
public UserFederationProvider getInstance(KeycloakSession session, UserFederationProviderModel model) {
|
||||||
|
return new DummyUserFederationProvider();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getConfigurationOptions() {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
list.add("important.config");
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserFederationProvider create(KeycloakSession session) {
|
||||||
|
return new DummyUserFederationProvider();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Config.Scope config) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return "dummy";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
org.keycloak.testutils.DummyUserFederationProviderFactory
|
Loading…
Reference in a new issue