-
Notifications
You must be signed in to change notification settings - Fork 608
Enhance outbound provisioning with resident SP fallback and sub-organization support #7765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
52a92f0
4094c56
a7450fe
eced60b
cf35eb8
a05ce0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -357,9 +357,7 @@ public void provision(ProvisioningEntity provisioningEntity, String serviceProvi | |
| } | ||
|
|
||
| // Any provisioning request coming via Console, considered as coming from the resident SP. | ||
| // If the application based outbound provisioning is disabled, resident SP configuration will be used. | ||
| if (StringUtils.equals(CONSOLE_APPLICATION_NAME, serviceProviderIdentifier) || | ||
| !isApplicationBasedOutboundProvisioningEnabled()) { | ||
| if (StringUtils.equals(CONSOLE_APPLICATION_NAME, serviceProviderIdentifier)) { | ||
| serviceProviderIdentifier = LOCAL_SP; | ||
| inboundClaimDialect = IdentityProvisioningConstants.WSO2_CARBON_DIALECT; | ||
| } | ||
|
|
@@ -393,6 +391,21 @@ public void provision(ProvisioningEntity provisioningEntity, String serviceProvi | |
| Map<String, RuntimeProvisioningConfig> connectors = | ||
| getOutboundProvisioningConnectors(serviceProvider, spTenantDomainName); | ||
|
|
||
| // When application-based outbound provisioning is disabled and the application has no | ||
| // outbound provisioning connectors configured, fall back to LOCAL_SP (resident app) connectors. | ||
| if (!isApplicationBasedOutboundProvisioningEnabled() && MapUtils.isEmpty(connectors) | ||
| && !LOCAL_SP.equals(serviceProviderIdentifier)) { | ||
|
Comment on lines
+385
to
+388
|
||
| ServiceProvider localSP = ApplicationManagementService.getInstance() | ||
|
Comment on lines
+385
to
+389
|
||
| .getServiceProvider(LOCAL_SP, spTenantDomainName); | ||
| if (localSP != null) { | ||
PasinduYeshan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| serviceProvider = localSP; | ||
| connectors = getOutboundProvisioningConnectors(localSP, spTenantDomainName); | ||
| inboundClaimDialect = IdentityProvisioningConstants.WSO2_CARBON_DIALECT; | ||
| // LOCAL_SP uses WSO2_CARBON_DIALECT; spClaimMappings is not needed. | ||
| spClaimMappings = null; | ||
| } | ||
| } | ||
|
|
||
| ProvisioningEntity outboundProEntity; | ||
|
|
||
| ExecutorService executors = null; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) | ||
| * Copyright (c) 2022-2026, WSO2 Inc. (http://www.wso2.org) | ||
| * | ||
| * WSO2 Inc. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
|
Comment on lines
1
to
5
|
||
|
|
@@ -296,13 +296,13 @@ private boolean outboundProvisionEntity(ProvisioningEntity provisioningEntity) t | |
|
|
||
| if (threadLocalServiceProvider != null) { | ||
| String serviceProvider = threadLocalServiceProvider.getServiceProviderName(); | ||
| tenantDomainName = threadLocalServiceProvider.getTenantDomain(); | ||
| if (threadLocalServiceProvider.getServiceProviderType() == ProvisioningServiceProviderType.OAUTH) { | ||
| try { | ||
| serviceProvider = ApplicationManagementService.getInstance() | ||
| .getServiceProviderNameByClientId( | ||
| threadLocalServiceProvider.getServiceProviderName(), | ||
| IdentityApplicationConstants.OAuth2.NAME, tenantDomainName); | ||
| IdentityApplicationConstants.OAuth2.NAME, | ||
| threadLocalServiceProvider.getTenantDomain()); | ||
PasinduYeshan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } catch (IdentityApplicationManagementException e) { | ||
| log.error("Error while provisioning", e); | ||
PasinduYeshan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return true; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.