fix: cognito groups matching fixed.

This commit is contained in:
Evgeny Petrushevsky 2023-08-29 17:32:12 +02:00
parent 80024c8758
commit 4ae3578b31

View file

@ -59,8 +59,8 @@ public class CognitoAuthorityExtractor implements ProviderAuthorityExtractor {
.stream() .stream()
.filter(s -> s.getProvider().equals(Provider.OAUTH_COGNITO)) .filter(s -> s.getProvider().equals(Provider.OAUTH_COGNITO))
.filter(s -> s.getType().equals("group")) .filter(s -> s.getType().equals("group"))
.anyMatch(subject -> Stream.of(groups) .anyMatch(subject -> groups
.map(Object::toString) .stream()
.anyMatch(cognitoGroup -> cognitoGroup.equals(subject.getValue())) .anyMatch(cognitoGroup -> cognitoGroup.equals(subject.getValue()))
)) ))
.map(Role::getName) .map(Role::getName)