|
|
|
@ -160,13 +160,15 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
|
|
|
|
|
"Service");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServiceProvider existingServiceProvider = appMgtService.getApplication(applicationName);
|
|
|
|
|
ServiceProvider existingServiceProvider = appMgtService.getServiceProvider(
|
|
|
|
|
applicationName, tenantDomain);
|
|
|
|
|
|
|
|
|
|
if (existingServiceProvider == null) {
|
|
|
|
|
appMgtService.createApplication(serviceProvider);
|
|
|
|
|
appMgtService.createApplication(serviceProvider, userName, tenantDomain);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName);
|
|
|
|
|
ServiceProvider createdServiceProvider = appMgtService.getServiceProvider(
|
|
|
|
|
applicationName, tenantDomain);
|
|
|
|
|
if (createdServiceProvider == null) {
|
|
|
|
|
throw new DynamicClientRegistrationException(
|
|
|
|
|
"Couldn't create Service Provider Application " + applicationName);
|
|
|
|
@ -254,7 +256,7 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
|
|
|
|
|
createdServiceProvider.setLocalAndOutBoundAuthenticationConfig(localOutboundAuthConfig);
|
|
|
|
|
|
|
|
|
|
// Update the Service Provider app to add OAuthApp as an Inbound Authentication Config
|
|
|
|
|
appMgtService.updateApplication(createdServiceProvider);
|
|
|
|
|
appMgtService.updateApplication(createdServiceProvider, tenantDomain, userName);
|
|
|
|
|
|
|
|
|
|
OAuthApplicationInfo oAuthApplicationInfo = new OAuthApplicationInfo();
|
|
|
|
|
oAuthApplicationInfo.setClientId(createdApp.getOauthConsumerKey());
|
|
|
|
@ -329,12 +331,13 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
|
|
|
|
|
"Error occurred while retrieving Application Management" +
|
|
|
|
|
"Service");
|
|
|
|
|
}
|
|
|
|
|
ServiceProvider createdServiceProvider = appMgtService.getApplication(applicationName);
|
|
|
|
|
ServiceProvider createdServiceProvider = appMgtService.getServiceProvider(
|
|
|
|
|
applicationName, tenantDomain);
|
|
|
|
|
if (createdServiceProvider == null) {
|
|
|
|
|
throw new DynamicClientRegistrationException(
|
|
|
|
|
"Couldn't retrieve Service Provider Application " + applicationName);
|
|
|
|
|
}
|
|
|
|
|
appMgtService.deleteApplication(applicationName);
|
|
|
|
|
appMgtService.deleteApplication(applicationName, tenantDomain, userName);
|
|
|
|
|
status = true;
|
|
|
|
|
} catch (IdentityApplicationManagementException e) {
|
|
|
|
|
throw new DynamicClientRegistrationException(
|
|
|
|
@ -361,7 +364,8 @@ public class DynamicClientRegistrationImpl implements DynamicClientRegistrationS
|
|
|
|
|
"Service");
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if (ApplicationManagementService.getInstance().getApplication(applicationName) != null) {
|
|
|
|
|
if (ApplicationManagementService.getInstance().getServiceProvider(applicationName,
|
|
|
|
|
CarbonContext.getThreadLocalCarbonContext().getTenantDomain()) != null) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} catch (IdentityApplicationManagementException e) {
|
|
|
|
|