Skip to content
Snippets Groups Projects
Commit d73afa50 authored by Dominik František Bučík's avatar Dominik František Bučík
Browse files

chore: merge branch 'fix_dynreg' into 'main'

fix: :bug: requested parameters in dynreg

See merge request perun-proxy-aai/java/OpenID-Connect-Java-Spring-Server!367
parents 0270be29 1c18b72c
Branches
Tags
1 merge request!367fix: 🐛 requested parameters in dynreg
Pipeline #382822 passed with warnings
......@@ -129,7 +129,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
if (scope != null && !scope.isEmpty()) {
Set<SystemScope> allScopes = scopeService.getAll();
for (String scopeStr: scope) {
if (allScopes.contains(scopeService.fromString(scopeStr))) {
if (!allScopes.contains(scopeService.fromString(scopeStr))) {
throw new InvalidRequestException("Unsupported scope requested: " + scopeStr);
}
}
......@@ -146,7 +146,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
"urn:ietf:params:oauth:grant-type:device_code");
if (grants != null && !grants.isEmpty()) {
for (String grant : grants) {
if (supportedGrants.contains(grant)) {
if (!supportedGrants.contains(grant)) {
throw new InvalidRequestException("Unsupported grant type requested: " + grant);
}
}
......@@ -156,7 +156,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
Set<String> supportedResponseTypes = Set.of("code", "token id_token");
if (responseTypes != null && !responseTypes.isEmpty()) {
for (String responseType : responseTypes) {
if (supportedResponseTypes.contains(responseType)) {
if (!supportedResponseTypes.contains(responseType)) {
throw new InvalidRequestException("Unsupported response type requested: " + responseType);
}
}
......@@ -173,7 +173,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
throw new InvalidRequestException("Unsupported application type: " + appType);
}
String subjectType = clientRequest.getSubjectType();
if (StringUtils.hasText(subjectType) && (!SubjectType.isSupported(subjectType))) {
if (StringUtils.hasText(subjectType) && !SubjectType.isSupported(subjectType)) {
throw new InvalidRequestException("Unsupported subject type: " + subjectType);
}
if (StringUtils.hasText(clientRequest.getRequestObjectSigningAlg())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment