rename scope rep username to client
This commit is contained in:
parent
48d39bf977
commit
42d30a5a70
10 changed files with 23 additions and 23 deletions
|
@ -159,7 +159,7 @@ public class RealmRepresentation {
|
|||
|
||||
public ScopeMappingRepresentation scopeMapping(String username) {
|
||||
ScopeMappingRepresentation mapping = new ScopeMappingRepresentation();
|
||||
mapping.setUsername(username);
|
||||
mapping.setClient(username);
|
||||
if (scopeMappings == null) scopeMappings = new ArrayList<ScopeMappingRepresentation>();
|
||||
scopeMappings.add(mapping);
|
||||
return mapping;
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Set;
|
|||
*/
|
||||
public class ScopeMappingRepresentation {
|
||||
protected String self; // link
|
||||
protected String username;
|
||||
protected String client;
|
||||
protected Set<String> roles;
|
||||
|
||||
public String getSelf() {
|
||||
|
@ -20,12 +20,12 @@ public class ScopeMappingRepresentation {
|
|||
this.self = self;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public Set<String> getRoles() {
|
||||
|
|
|
@ -44,15 +44,15 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "third-party",
|
||||
"client": "third-party",
|
||||
"roles": ["user"]
|
||||
},
|
||||
{
|
||||
"username": "customer-portal",
|
||||
"client": "customer-portal",
|
||||
"roles": ["user"]
|
||||
},
|
||||
{
|
||||
"username": "product-portal",
|
||||
"client": "product-portal",
|
||||
"roles": ["user"]
|
||||
}
|
||||
|
||||
|
|
|
@ -91,11 +91,11 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "REALM_COMPOSITE_1_APPLICATION",
|
||||
"client": "REALM_COMPOSITE_1_APPLICATION",
|
||||
"roles": ["REALM_COMPOSITE_1"]
|
||||
},
|
||||
{
|
||||
"username": "REALM_ROLE_1_APPLICATION",
|
||||
"client": "REALM_ROLE_1_APPLICATION",
|
||||
"roles": ["REALM_ROLE_1"]
|
||||
}
|
||||
],
|
||||
|
@ -221,7 +221,7 @@
|
|||
"applicationScopeMappings": {
|
||||
"APP_ROLE_APPLICATION": [
|
||||
{
|
||||
"username": "APP_COMPOSITE_APPLICATION",
|
||||
"client": "APP_COMPOSITE_APPLICATION",
|
||||
"roles": ["APP_ROLE_2"]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "third-party",
|
||||
"client": "third-party",
|
||||
"roles": ["user"]
|
||||
}
|
||||
],
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "oauthclient",
|
||||
"client": "oauthclient",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
],
|
||||
|
@ -148,7 +148,7 @@
|
|||
"applicationScopeMappings": {
|
||||
"Application": [
|
||||
{
|
||||
"username": "oauthclient",
|
||||
"client": "oauthclient",
|
||||
"roles": ["app-user"]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -123,7 +123,7 @@ public class ApplicationManager {
|
|||
if (role == null) {
|
||||
role = applicationModel.addRole(roleString.trim());
|
||||
}
|
||||
ClientModel client = realm.findClient(mapping.getUsername());
|
||||
ClientModel client = realm.findClient(mapping.getClient());
|
||||
realm.addScopeMapping(client, role);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ public class RealmManager {
|
|||
if (role == null) {
|
||||
role = newRealm.addRole(roleString.trim());
|
||||
}
|
||||
UserModel user = userMap.get(scope.getUsername());
|
||||
UserModel user = userMap.get(scope.getClient());
|
||||
ClientModel client = newRealm.findClient(user.getLoginName());
|
||||
newRealm.addScopeMapping(client, role);
|
||||
}
|
||||
|
|
|
@ -91,11 +91,11 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "REALM_COMPOSITE_1_APPLICATION",
|
||||
"client": "REALM_COMPOSITE_1_APPLICATION",
|
||||
"roles": ["REALM_COMPOSITE_1"]
|
||||
},
|
||||
{
|
||||
"username": "REALM_ROLE_1_APPLICATION",
|
||||
"client": "REALM_ROLE_1_APPLICATION",
|
||||
"roles": ["REALM_ROLE_1"]
|
||||
}
|
||||
],
|
||||
|
@ -221,7 +221,7 @@
|
|||
"applicationScopeMappings": {
|
||||
"APP_ROLE_APPLICATION": [
|
||||
{
|
||||
"username": "APP_COMPOSITE_APPLICATION",
|
||||
"client": "APP_COMPOSITE_APPLICATION",
|
||||
"roles": ["APP_ROLE_2"]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -46,11 +46,11 @@
|
|||
],
|
||||
"scopeMappings": [
|
||||
{
|
||||
"username": "third-party",
|
||||
"client": "third-party",
|
||||
"roles": ["user"]
|
||||
},
|
||||
{
|
||||
"username": "test-app",
|
||||
"client": "test-app",
|
||||
"roles": ["user"]
|
||||
}
|
||||
],
|
||||
|
@ -105,7 +105,7 @@
|
|||
"applicationScopeMappings": {
|
||||
"test-app": [
|
||||
{
|
||||
"username": "third-party",
|
||||
"client": "third-party",
|
||||
"roles": ["customer-user"]
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue