KEYCLOAK-43 ApplicationAdapter.addScope doesn't add scope into IDM
This commit is contained in:
parent
d97a615c81
commit
0b9a59950a
2 changed files with 8 additions and 0 deletions
|
@ -154,6 +154,7 @@ public class ApplicationAdapter implements ApplicationModel {
|
|||
ScopeRelationship scope = new ScopeRelationship();
|
||||
scope.setClient(((UserAdapter)agent).getUser());
|
||||
scope.setScope(((RoleAdapter)role).getRole());
|
||||
getRelationshipManager().add(scope);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -87,6 +87,13 @@ public class ImportTest {
|
|||
List<RealmModel> realms = identitySession.getRealms(admin);
|
||||
Assert.assertEquals(1, realms.size());
|
||||
|
||||
// Test scope relationship
|
||||
ApplicationModel application = realm.getResourceNameMap().get("Application");
|
||||
UserModel oauthClient = realm.getUser("oauthclient");
|
||||
Assert.assertNotNull(application);
|
||||
Assert.assertNotNull(oauthClient);
|
||||
Set<String> appScopes = application.getScope(oauthClient);
|
||||
Assert.assertTrue(appScopes.contains("user"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue