/** * Update the application name if OAuth application presents. * * @param serviceProvider Service provider * @throws IdentityApplicationManagementException */ private void updateAuthApplication(ServiceProvider serviceProvider) throws IdentityApplicationManagementException { InboundAuthenticationRequestConfig authenticationRequestConfigConfig = null; if (serviceProvider.getInboundAuthenticationConfig() != null && serviceProvider.getInboundAuthenticationConfig() .getInboundAuthenticationRequestConfigs() != null) { for (InboundAuthenticationRequestConfig authConfig : serviceProvider.getInboundAuthenticationConfig() .getInboundAuthenticationRequestConfigs()) { if (StringUtils.equals(authConfig.getInboundAuthType(), "oauth") || StringUtils.equals(authConfig.getInboundAuthType(), "oauth2")) { authenticationRequestConfigConfig = authConfig; break; } } } if (authenticationRequestConfigConfig == null) { return; } OAuthAppDAO dao = new OAuthAppDAO(); dao.updateOAuthConsumerApp(serviceProvider.getApplicationName(), authenticationRequestConfigConfig.getInboundAuthKey()); }
/** * Update the application name if OAuth application presents. * * @param serviceProvider Service provider * @throws IdentityApplicationManagementException */ private void updateAuthApplication(ServiceProvider serviceProvider) throws IdentityApplicationManagementException { InboundAuthenticationRequestConfig authenticationRequestConfigConfig = null; if (serviceProvider.getInboundAuthenticationConfig() != null && serviceProvider.getInboundAuthenticationConfig() .getInboundAuthenticationRequestConfigs() != null) { for (InboundAuthenticationRequestConfig authConfig : serviceProvider.getInboundAuthenticationConfig() .getInboundAuthenticationRequestConfigs()) { if (StringUtils.equals(authConfig.getInboundAuthType(), "oauth") || StringUtils.equals(authConfig.getInboundAuthType(), "oauth2")) { authenticationRequestConfigConfig = authConfig; break; } } } if (authenticationRequestConfigConfig == null) { return; } OAuthAppDAO dao = new OAuthAppDAO(); dao.updateOAuthConsumerApp(serviceProvider.getApplicationName(), authenticationRequestConfigConfig.getInboundAuthKey()); }