Skip to content
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

Fix the federated association failure when organization user accessing MyAccount #186

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.identity.api.user.common.error.APIError;
import org.wso2.carbon.identity.api.user.common.error.ErrorResponse;
import org.wso2.carbon.identity.api.user.common.function.UserToUniqueId;
Expand Down Expand Up @@ -368,6 +369,11 @@ private String getUserIdFromUser(User user) {

private String getFederatedUserIdFromUser(User user) {

String userResidentOrg = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserResidentOrganizationId();
// The organization SSO user's ID is correctly set in the carbon context.
if (StringUtils.isNotEmpty(userResidentOrg)) {
return PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId();
}
if (!IdentityUtil.threadLocalProperties.get().containsKey(IDP_NAME)) {
if (log.isDebugEnabled()) {
log.debug("Idp name cannot be found in thread local.");
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
<version.org.wso2.orbit.javax.xml.bind>2.3.1.wso2v1</version.org.wso2.orbit.javax.xml.bind>
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>
<org.apache.felix.annotations.version>1.2.4</org.apache.felix.annotations.version>
<carbon.kernel.version>4.9.0</carbon.kernel.version>
<carbon.kernel.version>4.9.17</carbon.kernel.version>
<identity.governance.version>1.8.73</identity.governance.version>
<carbon.identity.framework.version>5.25.380</carbon.identity.framework.version>
<carbon.identity.account.association.version>5.3.7</carbon.identity.account.association.version>
Expand Down
Loading