/** * Validate requested grants in the oauth app. * * @param requestedGrants list of requested grants * @param validationMsg validation msg list */ private void validateGrants(String[] requestedGrants, List<String> validationMsg) { OAuthAdminService oAuthAdminService = new OAuthAdminService(); List<String> allowedGrants = new ArrayList<>(Arrays.asList(oAuthAdminService.getAllowedGrantTypes())); for (String requestedGrant : requestedGrants) { if (StringUtils.isBlank(requestedGrant)) { continue; } if (!allowedGrants.contains(requestedGrant)) { validationMsg.add(String.format("Grant type %s not allowed", requestedGrant)); } } }
} else { String[] allowedGrantTypes = oAuthAdminService.getAllowedGrantTypes(); StringBuilder grantTypeString = new StringBuilder();
} else { String[] allowedGrantTypes = oAuthAdminService.getAllowedGrantTypes(); StringBuilder grantTypeString = new StringBuilder();
} else { allowedGrantTypes = oAuthAdminService.getAllowedGrantTypes(); allowedGrantTypes = oAuthAdminService.getAllowedGrantTypes();
oauthappdo.setBypassClientCredentials(consumerAppDTO.isBypassClientCredentials()); if (OAuthConstants.OAuthVersions.VERSION_2.equals(consumerAppDTO.getOAuthVersion())) { List<String> allowedGrantsTypes = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = consumerAppDTO.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) {
oauthappdo.setPkceSupportPlain(consumerAppDTO.getPkceSupportPlain()); if (OAuthConstants.OAuthVersions.VERSION_2.equals(consumerAppDTO.getOAuthVersion())) { List<String> allowedGrants = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = consumerAppDTO.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) {
List<String> allowedGrantTypes = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = application.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) {
List<String> allowedGrants = new ArrayList<>(Arrays.asList(getAllowedGrantTypes())); String[] requestGrants = application.getGrantTypes().split("\\s"); for (String requestedGrant : requestGrants) {