/** * Validate scope validators in the oauth app. * * @param appScopeValidators list of scope validators * @param validationMsg validation msg list */ private void validateScopeValidators(String[] appScopeValidators, List<String> validationMsg) { OAuthAdminService oAuthAdminService = new OAuthAdminService(); List<String> scopeValidators = new ArrayList<>(Arrays.asList(oAuthAdminService.getAllowedScopeValidators())); Arrays.stream(appScopeValidators).forEach(validator -> { if (!scopeValidators.contains(validator)) { validationMsg.add(String.format("The scope validator %s is not available in the " + "server configuration. ", validator)); } }); }
/** * 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)); } } }
OAuthAdminService oAuthAdminService = new OAuthAdminService(); OAuthConsumerAppDTO oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey);
OAuthAdminService oAuthAdminService = new OAuthAdminService(); OAuthConsumerAppDTO oAuthConsumerAppDTO = oAuthAdminService.getOAuthApplicationData(consumerKey); if (oAuthConsumerAppDTO != null) {
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(userName); OAuthAdminService oAuthAdminService = new OAuthAdminService(); OAuthConsumerAppDTO oAuthConsumerApp = null; try {
log.debug("Avoided removing the default app : " + spAppName); log.debug("However, OAuth details for the default app will be removed."); OAuthAdminService oAuthAdminService = new OAuthAdminService(); oAuthAdminService.removeOAuthApplicationData(consumerKey); } else {
OAuthAdminService oAuthAdminService = new OAuthAdminService(); OAuthConsumerAppDTO oAuthConsumerAppDTO = new OAuthConsumerAppDTO(); oAuthConsumerAppDTO.setApplicationName(applicationName);
OAuthAdminService oAuthAdminService = new OAuthAdminService();
OAuthAdminService oAuthAdminService = new OAuthAdminService();
OAuthConsumerAppDTO oAuthConsumerApp; try { oAuthAdminService = new OAuthAdminService(); oAuthConsumerApp = oAuthAdminService.getOAuthApplicationData(consumerKey); } catch (Exception e) {