Skip to content

Commit

Permalink
Rely on original security context even for profiles
Browse files Browse the repository at this point in the history
When multiple security filters are used, a pac4j security context
can rely on an already authenticated pac4j security context.
In this case, it must delegate to the original if it doesn't itself
have some profiles stored.
  • Loading branch information
victornoel committed Jun 16, 2018
1 parent 0d0245a commit 045fae4
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -56,6 +56,8 @@ public Pac4JSecurityContext(SecurityContext original, JaxRsContext context,
public Optional<Collection<CommonProfile>> getProfiles() {
if (principal != null) {
return Optional.of(Collections.unmodifiableCollection(profiles));
} else if (original instanceof Pac4JSecurityContext) {
return ((Pac4JSecurityContext) original).getProfiles();
} else {
return Optional.empty();
}
Expand Down

0 comments on commit 045fae4

Please sign in to comment.