Skip to content

Commit

Permalink
SHIBUI-1747
Browse files Browse the repository at this point in the history
fixed NPE with roles
  • Loading branch information
chasegawa committed Sep 17, 2021
1 parent f27a026 commit 2b84ea7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ public List<String> getGroups() {
}

public Set<String> getRoles() {
Set<String> result = (Set<String>) getAttribute(profileMapping.getRoles());
return result == null ? new HashSet<>() : result;
Set<String> result = new HashSet<>();
List<String> assertedRoles = (List<String>) getAttribute(profileMapping.getRoles());
if (assertedRoles != null) {
result.addAll(assertedRoles);
}
return result;
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions testbed/authentication/shibui/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ shibui:
firstName: urn:oid:2.5.4.42
lastName: urn:oid:2.5.4.4
email: urn:oid:0.9.2342.19200300.100.1.3
groups: businessCategory
roles: urn:oid:1.3.6.1.4.1.5923.1.1.1.7

0 comments on commit 2b84ea7

Please sign in to comment.