Skip to content
Snippets Groups Projects
Verified Commit 1c18b72c authored by Dominik Frantisek Bucik's avatar Dominik Frantisek Bucik
Browse files

fix: :bug: requested parameters in dynreg

parent 0270be29
Branches
Tags
1 merge request!367fix: 🐛 requested parameters in dynreg
Pipeline #382817 passed with warnings
...@@ -129,7 +129,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist ...@@ -129,7 +129,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
if (scope != null && !scope.isEmpty()) { if (scope != null && !scope.isEmpty()) {
Set<SystemScope> allScopes = scopeService.getAll(); Set<SystemScope> allScopes = scopeService.getAll();
for (String scopeStr: scope) { for (String scopeStr: scope) {
if (allScopes.contains(scopeService.fromString(scopeStr))) { if (!allScopes.contains(scopeService.fromString(scopeStr))) {
throw new InvalidRequestException("Unsupported scope requested: " + scopeStr); throw new InvalidRequestException("Unsupported scope requested: " + scopeStr);
} }
} }
...@@ -146,7 +146,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist ...@@ -146,7 +146,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
"urn:ietf:params:oauth:grant-type:device_code"); "urn:ietf:params:oauth:grant-type:device_code");
if (grants != null && !grants.isEmpty()) { if (grants != null && !grants.isEmpty()) {
for (String grant : grants) { for (String grant : grants) {
if (supportedGrants.contains(grant)) { if (!supportedGrants.contains(grant)) {
throw new InvalidRequestException("Unsupported grant type requested: " + grant); throw new InvalidRequestException("Unsupported grant type requested: " + grant);
} }
} }
...@@ -156,7 +156,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist ...@@ -156,7 +156,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
Set<String> supportedResponseTypes = Set.of("code", "token id_token"); Set<String> supportedResponseTypes = Set.of("code", "token id_token");
if (responseTypes != null && !responseTypes.isEmpty()) { if (responseTypes != null && !responseTypes.isEmpty()) {
for (String responseType : responseTypes) { for (String responseType : responseTypes) {
if (supportedResponseTypes.contains(responseType)) { if (!supportedResponseTypes.contains(responseType)) {
throw new InvalidRequestException("Unsupported response type requested: " + responseType); throw new InvalidRequestException("Unsupported response type requested: " + responseType);
} }
} }
...@@ -173,7 +173,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist ...@@ -173,7 +173,7 @@ public class DynamicClientRegistrationServiceImpl implements DynamicClientRegist
throw new InvalidRequestException("Unsupported application type: " + appType); throw new InvalidRequestException("Unsupported application type: " + appType);
} }
String subjectType = clientRequest.getSubjectType(); 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); throw new InvalidRequestException("Unsupported subject type: " + subjectType);
} }
if (StringUtils.hasText(clientRequest.getRequestObjectSigningAlg())) { 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