diff --git a/core/src/main/java/org/keycloak/representations/idm/AllRoleMappingsRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/AllRoleMappingsRepresentation.java index 1d39896165..4377756392 100755 --- a/core/src/main/java/org/keycloak/representations/idm/AllRoleMappingsRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/AllRoleMappingsRepresentation.java @@ -13,7 +13,7 @@ public class AllRoleMappingsRepresentation { protected String username; protected List realmMappings; - protected Map applicationMappings; + protected Map applicationMappings; public String getRealmId() { return realmId; @@ -47,11 +47,11 @@ public class AllRoleMappingsRepresentation { this.realmMappings = realmMappings; } - public Map getApplicationMappings() { + public Map getApplicationMappings() { return applicationMappings; } - public void setApplicationMappings(Map applicationMappings) { + public void setApplicationMappings(Map applicationMappings) { this.applicationMappings = applicationMappings; } } diff --git a/core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappings.java b/core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappingsRepresentation.java similarity index 91% rename from core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappings.java rename to core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappingsRepresentation.java index d4cb445258..88e8ea32a2 100755 --- a/core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappings.java +++ b/core/src/main/java/org/keycloak/representations/idm/ApplicationRoleMappingsRepresentation.java @@ -6,7 +6,7 @@ import java.util.List; * @author Bill Burke * @version $Revision: 1 $ */ -public class ApplicationRoleMappings { +public class ApplicationRoleMappingsRepresentation { protected String applicationId; protected String application; protected String username; diff --git a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java index 3e2b23e022..36d8b335c2 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java @@ -12,17 +12,17 @@ public class RealmRepresentation { protected String self; // link protected String id; protected String realm; - protected int tokenLifespan; - protected int accessCodeLifespan; - protected int accessCodeLifespanUserAction; - protected boolean enabled; - protected boolean sslNotRequired; - protected boolean cookieLoginAllowed; - protected boolean registrationAllowed; - protected boolean verifyEmail; - protected boolean resetPasswordAllowed; - protected boolean social; - protected boolean automaticRegistrationAfterSocialLogin; + protected Integer tokenLifespan; + protected Integer accessCodeLifespan; + protected Integer accessCodeLifespanUserAction; + protected Boolean enabled; + protected Boolean sslNotRequired; + protected Boolean cookieLoginAllowed; + protected Boolean registrationAllowed; + protected Boolean verifyEmail; + protected Boolean resetPasswordAllowed; + protected Boolean social; + protected Boolean automaticRegistrationAfterSocialLogin; protected String privateKey; protected String publicKey; protected List roles; @@ -93,35 +93,35 @@ public class RealmRepresentation { this.applications = applications; } - public boolean isEnabled() { + public Boolean isEnabled() { return enabled; } - public void setEnabled(boolean enabled) { + public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public boolean isSslNotRequired() { + public Boolean isSslNotRequired() { return sslNotRequired; } - public void setSslNotRequired(boolean sslNotRequired) { + public void setSslNotRequired(Boolean sslNotRequired) { this.sslNotRequired = sslNotRequired; } - public boolean isCookieLoginAllowed() { + public Boolean isCookieLoginAllowed() { return cookieLoginAllowed; } - public void setCookieLoginAllowed(boolean cookieLoginAllowed) { + public void setCookieLoginAllowed(Boolean cookieLoginAllowed) { this.cookieLoginAllowed = cookieLoginAllowed; } - public int getTokenLifespan() { + public Integer getTokenLifespan() { return tokenLifespan; } - public void setTokenLifespan(int tokenLifespan) { + public void setTokenLifespan(Integer tokenLifespan) { this.tokenLifespan = tokenLifespan; } @@ -185,19 +185,19 @@ public class RealmRepresentation { this.requiredOAuthClientCredentials = requiredOAuthClientCredentials; } - public int getAccessCodeLifespan() { + public Integer getAccessCodeLifespan() { return accessCodeLifespan; } - public void setAccessCodeLifespan(int accessCodeLifespan) { + public void setAccessCodeLifespan(Integer accessCodeLifespan) { this.accessCodeLifespan = accessCodeLifespan; } - public int getAccessCodeLifespanUserAction() { + public Integer getAccessCodeLifespanUserAction() { return accessCodeLifespanUserAction; } - public void setAccessCodeLifespanUserAction(int accessCodeLifespanUserAction) { + public void setAccessCodeLifespanUserAction(Integer accessCodeLifespanUserAction) { this.accessCodeLifespanUserAction = accessCodeLifespanUserAction; } @@ -233,43 +233,43 @@ public class RealmRepresentation { this.publicKey = publicKey; } - public boolean isRegistrationAllowed() { + public Boolean isRegistrationAllowed() { return registrationAllowed; } - public void setRegistrationAllowed(boolean registrationAllowed) { + public void setRegistrationAllowed(Boolean registrationAllowed) { this.registrationAllowed = registrationAllowed; } - public boolean isVerifyEmail() { + public Boolean isVerifyEmail() { return verifyEmail; } - public void setVerifyEmail(boolean verifyEmail) { + public void setVerifyEmail(Boolean verifyEmail) { this.verifyEmail = verifyEmail; } - public boolean isResetPasswordAllowed() { + public Boolean isResetPasswordAllowed() { return resetPasswordAllowed; } - public void setResetPasswordAllowed(boolean resetPassword) { + public void setResetPasswordAllowed(Boolean resetPassword) { this.resetPasswordAllowed = resetPassword; } - public boolean isSocial() { + public Boolean isSocial() { return social; } - public void setSocial(boolean social) { + public void setSocial(Boolean social) { this.social = social; } - public boolean isAutomaticRegistrationAfterSocialLogin() { + public Boolean isAutomaticRegistrationAfterSocialLogin() { return automaticRegistrationAfterSocialLogin; } - public void setAutomaticRegistrationAfterSocialLogin(boolean automaticRegistrationAfterSocialLogin) { + public void setAutomaticRegistrationAfterSocialLogin(Boolean automaticRegistrationAfterSocialLogin) { this.automaticRegistrationAfterSocialLogin = automaticRegistrationAfterSocialLogin; } } diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/app.js b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/app.js index 211ed20369..19e6f97319 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/app.js +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/app.js @@ -26,8 +26,24 @@ module.config([ '$routeProvider', function($routeProvider) { }).when('/realms', { templateUrl : 'partials/realm-list.html', controller : 'RealmListCtrl' - }) - + }).when('/realms/:realm/token-settings', { + templateUrl : 'partials/realm-tokens.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + } + }, + controller : 'RealmTokenDetailCtrl' + }) + .when('/realms/:realm/required-credentials', { + templateUrl : 'partials/realm-credentials.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + } + }, + controller : 'RealmRequiredCredentialsCtrl' + }) .when('/create/user/:realm', { templateUrl : 'partials/user-detail.html', resolve : { diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js index 3dedcb065c..0ec3308727 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/js/controllers.js @@ -64,15 +64,7 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $ht $scope.realm = { enabled: true, requireSsl: true, - cookieLoginAllowed: true, - tokenLifespan: 300, - tokenLifespanUnit: 'SECONDS', - accessCodeLifespan: 300, - accessCodeLifespanUnit: 'SECONDS', - requiredCredentials: ['password'], - requiredOAuthClientCredentials: ['password'], - requiredApplicationCredentials: ['password'] - + cookieLoginAllowed: true }; } else { if (Current.realm == null || Current.realm.id != realm.id) { @@ -90,21 +82,12 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $ht } $scope.realm = angular.copy(realm); $scope.realm.requireSsl = !realm.sslNotRequired; - $scope.realm.tokenLifespanUnit = 'SECONDS'; - $scope.realm.accessCodeLifespanUnit = 'SECONDS'; - } var oldCopy = angular.copy($scope.realm); - $scope.userCredentialOptions = { - 'multiple' : true, - 'simple_tags' : true, - 'tags' : ['password', 'totp', 'cert'] - }; - $scope.changed = $scope.create; $scope.$watch('realm', function() { @@ -118,8 +101,6 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $ht var realmCopy = angular.copy($scope.realm); realmCopy.sslNotRequired = !realmCopy.requireSsl; delete realmCopy["requireSsl"]; - delete realmCopy["tokenLifespanUnit"]; - delete realmCopy["accessCodeLifespanUnit"]; if ($scope.createRealm) { Realm.save(realmCopy, function(data, headers) { console.log('creating new realm'); @@ -180,6 +161,105 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, $ht }; }); +module.controller('RealmRequiredCredentialsCtrl', function($scope, Realm, realm, $http, $location, Dialog, Notifications) { + console.log('RealmRequiredCredentialsCtrl'); + + $scope.realm = { + id : realm.id, realm : realm.realm, + requiredCredentials : realm.requiredCredentials, + requiredApplicationCredentials : realm.requiredApplicationCredentials, + requiredOAuthClientCredentials : realm.requiredOAuthClientCredentials + }; + + $scope.userCredentialOptions = { + 'multiple' : true, + 'simple_tags' : true, + 'tags' : ['password', 'totp', 'cert'] + }; + + var oldCopy = angular.copy($scope.realm); + $scope.changed = false; + + $scope.$watch('realm', function() { + if (!angular.equals($scope.realm, oldCopy)) { + $scope.changed = true; + } + }, true); + + $scope.save = function() { + if ($scope.realmForm.$valid) { + var realmCopy = angular.copy($scope.realm); + $scope.changed = false; + Realm.update(realmCopy, function () { + $location.url("/realms/" + realm.id + "/required-credentials"); + Notifications.success("Saved changes to realm"); + }); + } else { + $scope.realmForm.showErrors = true; + } + }; + + $scope.reset = function() { + $scope.realm = angular.copy(oldCopy); + $scope.changed = false; + $scope.realmForm.showErrors = false; + }; +}); + + +module.controller('RealmTokenDetailCtrl', function($scope, Realm, realm, $http, $location, Dialog, Notifications) { + console.log('RealmTokenDetailCtrl'); + + $scope.realm = { id : realm.id, realm : realm.realm, tokenLifespan : realm.tokenLifespan, accessCodeLifespan : realm.accessCodeLifespan }; + $scope.realm.tokenLifespanUnit = 'Seconds'; + $scope.realm.accessCodeLifespanUnit = 'Seconds'; + + var oldCopy = angular.copy($scope.realm); + $scope.changed = false; + + $scope.$watch('realm', function() { + if (!angular.equals($scope.realm, oldCopy)) { + $scope.changed = true; + } + }, true); + + $scope.save = function() { + if ($scope.realmForm.$valid) { + var realmCopy = angular.copy($scope.realm); + delete realmCopy["tokenLifespanUnit"]; + delete realmCopy["accessCodeLifespanUnit"]; + if ($scope.realm.tokenLifespanUnit == 'Minutes') { + realmCopy.tokenLifespan = $scope.realm.tokenLifespan * 60; + } else if ($scope.realm.tokenLifespanUnit == 'Hours') { + realmCopy.tokenLifespan = $scope.realm.tokenLifespan * 60 * 60; + } else if ($scope.realm.tokenLifespanUnit == 'Days') { + realmCopy.tokenLifespan = $scope.realm.tokenLifespan * 60 * 60 * 24; + } + if ($scope.realm.accessCodeLifespanUnit == 'Minutes') { + realmCopy.accessCodeLifespan = $scope.realm.accessCodeLifespan * 60; + } else if ($scope.realm.accessCodeLifespanUnit == 'Hours') { + realmCopy.accessCodeLifespan = $scope.realm.accessCodeLifespan * 60 * 60; + } else if ($scope.realm.accessCodeLifespanUnit == 'Days') { + realmCopy.accessCodeLifespan = $scope.realm.accessCodeLifespan * 60 * 60 * 24; + } + $scope.changed = false; + Realm.update(realmCopy, function () { + $location.url("/realms/" + realm.id + "/token-settings"); + Notifications.success("Saved changes to realm"); + }); + } else { + $scope.realmForm.showErrors = true; + } + }; + + $scope.reset = function() { + $scope.realm = angular.copy(oldCopy); + $scope.changed = false; + $scope.realmForm.showErrors = false; + }; +}); + + module.controller('UserListCtrl', function($scope, realm, User) { $scope.realm = realm; diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-credentials.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-credentials.html index 14a0c63fec..62b1061375 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-credentials.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-credentials.html @@ -4,18 +4,19 @@

Realm: {{realm.realm}}

+

- Required Credentials + Required Credentials
diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html index cd3d0ba18b..087e45b6a1 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-detail.html @@ -7,8 +7,8 @@
  • Settings
  • Social
  • Roles
  • -
  • Required Credentials
  • -
  • Token Settings
  • +
  • Required Credentials
  • +
  • Token Settings
  • @@ -97,61 +97,6 @@
    -
    - Token Settings -
    - -
    - -
    - -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    - Default Credential Settings -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - - -
    - -
    -
    -
    diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html index 73f0ae592c..5d0c1c41d9 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-menu.html @@ -1,5 +1,5 @@
      -
    • Realm Settings
    • +
    • Realm Settings
    • Users
    • Applications
    • diff --git a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-tokens.html b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-tokens.html index 442ec88fa7..c1d38a7fb4 100755 --- a/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-tokens.html +++ b/examples/as7-eap-demo/server/src/main/webapp/saas/admin/partials/realm-tokens.html @@ -4,18 +4,19 @@

      Realm: {{realm.realm}}

      +

      - Token Settings + Token Settings
      diff --git a/services/src/main/java/org/keycloak/services/managers/RealmManager.java b/services/src/main/java/org/keycloak/services/managers/RealmManager.java index 2b0fb20fe0..5762c7bdc8 100755 --- a/services/src/main/java/org/keycloak/services/managers/RealmManager.java +++ b/services/src/main/java/org/keycloak/services/managers/RealmManager.java @@ -68,17 +68,17 @@ public class RealmManager { public void updateRealm(RealmRepresentation rep, RealmModel realm) { if (rep.getRealm() != null) realm.setName(rep.getRealm()); - realm.setEnabled(rep.isEnabled()); - realm.setSocial(rep.isSocial()); - realm.setCookieLoginAllowed(rep.isCookieLoginAllowed()); - realm.setRegistrationAllowed(rep.isRegistrationAllowed()); - realm.setVerifyEmail(rep.isVerifyEmail()); - realm.setResetPasswordAllowed(rep.isResetPasswordAllowed()); - realm.setAutomaticRegistrationAfterSocialLogin(rep.isAutomaticRegistrationAfterSocialLogin()); - realm.setSslNotRequired((rep.isSslNotRequired())); - realm.setAccessCodeLifespan(rep.getAccessCodeLifespan()); - realm.setAccessCodeLifespanUserAction(rep.getAccessCodeLifespanUserAction()); - realm.setTokenLifespan(rep.getTokenLifespan()); + if (rep.isEnabled() != null) realm.setEnabled(rep.isEnabled()); + if (rep.isSocial() != null) realm.setSocial(rep.isSocial()); + if (rep.isCookieLoginAllowed() != null) realm.setCookieLoginAllowed(rep.isCookieLoginAllowed()); + if (rep.isRegistrationAllowed() != null) realm.setRegistrationAllowed(rep.isRegistrationAllowed()); + if (rep.isVerifyEmail() != null) realm.setVerifyEmail(rep.isVerifyEmail()); + if (rep.isResetPasswordAllowed() != null) realm.setResetPasswordAllowed(rep.isResetPasswordAllowed()); + if (rep.isAutomaticRegistrationAfterSocialLogin() != null) realm.setAutomaticRegistrationAfterSocialLogin(rep.isAutomaticRegistrationAfterSocialLogin()); + if (rep.isSslNotRequired() != null) realm.setSslNotRequired((rep.isSslNotRequired())); + if (rep.getAccessCodeLifespan() != null) realm.setAccessCodeLifespan(rep.getAccessCodeLifespan()); + if (rep.getAccessCodeLifespanUserAction() != null) realm.setAccessCodeLifespanUserAction(rep.getAccessCodeLifespanUserAction()); + if (rep.getTokenLifespan() != null) realm.setTokenLifespan(rep.getTokenLifespan()); if (rep.getRequiredOAuthClientCredentials() != null) { realm.updateRequiredOAuthClientCredentials(rep.getRequiredOAuthClientCredentials()); } @@ -104,17 +104,24 @@ public class RealmManager { public void importRealm(RealmRepresentation rep, RealmModel newRealm) { newRealm.setName(rep.getRealm()); - newRealm.setEnabled(rep.isEnabled()); - newRealm.setSocial(rep.isSocial()); - newRealm.setTokenLifespan(rep.getTokenLifespan()); - newRealm.setAccessCodeLifespan(rep.getAccessCodeLifespan()); - newRealm.setAccessCodeLifespanUserAction(rep.getAccessCodeLifespanUserAction()); - newRealm.setSslNotRequired(rep.isSslNotRequired()); - newRealm.setCookieLoginAllowed(rep.isCookieLoginAllowed()); - newRealm.setRegistrationAllowed(rep.isRegistrationAllowed()); - newRealm.setVerifyEmail(rep.isVerifyEmail()); - newRealm.setResetPasswordAllowed(rep.isResetPasswordAllowed()); - newRealm.setAutomaticRegistrationAfterSocialLogin(rep.isAutomaticRegistrationAfterSocialLogin()); + if (rep.isEnabled() != null) newRealm.setEnabled(rep.isEnabled()); + if (rep.isSocial() != null) newRealm.setSocial(rep.isSocial()); + + if (rep.getTokenLifespan() != null) newRealm.setTokenLifespan(rep.getTokenLifespan()); + else newRealm.setTokenLifespan(300); + + if (rep.getAccessCodeLifespan() != null) newRealm.setAccessCodeLifespan(rep.getAccessCodeLifespan()); + else newRealm.setAccessCodeLifespan(60); + + if (rep.getAccessCodeLifespanUserAction() != null) newRealm.setAccessCodeLifespanUserAction(rep.getAccessCodeLifespanUserAction()); + else newRealm.setAccessCodeLifespanUserAction(300); + + if (rep.isSslNotRequired() != null) newRealm.setSslNotRequired(rep.isSslNotRequired()); + if (rep.isCookieLoginAllowed() != null) newRealm.setCookieLoginAllowed(rep.isCookieLoginAllowed()); + if (rep.isRegistrationAllowed() != null) newRealm.setRegistrationAllowed(rep.isRegistrationAllowed()); + if (rep.isVerifyEmail() != null) newRealm.setVerifyEmail(rep.isVerifyEmail()); + if (rep.isResetPasswordAllowed() != null) newRealm.setResetPasswordAllowed(rep.isResetPasswordAllowed()); + if (rep.isAutomaticRegistrationAfterSocialLogin() != null) newRealm.setAutomaticRegistrationAfterSocialLogin(rep.isAutomaticRegistrationAfterSocialLogin()); if (rep.getPrivateKey() == null || rep.getPublicKey() == null) { generateRealmKeys(newRealm); } else { @@ -128,18 +135,24 @@ public class RealmManager { for (String requiredCred : rep.getRequiredCredentials()) { addRequiredCredential(newRealm, requiredCred); } + } else { + addRequiredCredential(newRealm, CredentialRepresentation.PASSWORD); } if (rep.getRequiredApplicationCredentials() != null) { for (String requiredCred : rep.getRequiredApplicationCredentials()) { addResourceRequiredCredential(newRealm, requiredCred); } + } else { + addResourceRequiredCredential(newRealm, CredentialRepresentation.PASSWORD); } if (rep.getRequiredOAuthClientCredentials() != null) { for (String requiredCred : rep.getRequiredOAuthClientCredentials()) { addOAuthClientRequiredCredential(newRealm, requiredCred); } + } else { + addOAuthClientRequiredCredential(newRealm, CredentialRepresentation.PASSWORD); } if (rep.getUsers() != null) { diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index 4c72238c13..197432489e 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -59,7 +59,7 @@ public class RealmAdminResource { @PUT @Consumes("application/json") public void updateRealm(final RealmRepresentation rep) { - logger.info("updating realm: " + rep.getRealm()); + logger.info("updating realm: " + realm.getName()); new RealmManager(session).updateRealm(rep, realm); } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java index dd55e20f0e..1f06b0240c 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java @@ -9,7 +9,6 @@ import org.keycloak.services.models.*; import javax.ws.rs.*; import javax.ws.rs.container.ResourceContext; import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import java.util.ArrayList; @@ -150,11 +149,11 @@ public class UsersResource { List applications = realm.getApplications(); if (applications.size() > 0) { - Map appMappings = new HashMap(); + Map appMappings = new HashMap(); for (ApplicationModel application : applications) { List roleMappings = application.getRoleMappings(user); if (roleMappings.size() > 0) { - ApplicationRoleMappings mappings = new ApplicationRoleMappings(); + ApplicationRoleMappingsRepresentation mappings = new ApplicationRoleMappingsRepresentation(); mappings.setUsername(user.getLoginName()); mappings.setApplicationId(application.getId()); mappings.setApplication(application.getName()); @@ -257,7 +256,6 @@ public class UsersResource { throw new NotFoundException(); } - ApplicationRoleMappings rep = new ApplicationRoleMappings(); List mappings = application.getRoleMappings(user); List mapRep = new ArrayList(); for (RoleModel roleModel : mappings) {