diff --git a/components/org.wso2.carbon.identity.sts.passive/pom.xml b/components/org.wso2.carbon.identity.sts.passive/pom.xml index 4a93c3a0..0452f946 100644 --- a/components/org.wso2.carbon.identity.sts.passive/pom.xml +++ b/components/org.wso2.carbon.identity.sts.passive/pom.xml @@ -86,12 +86,12 @@ org.apache.wss4j wss4j-ws-security-common - 2.3.0 + 2.2.5 org.apache.wss4j wss4j-ws-security-dom - 2.3.0 + 2.2.5 org.apache.cxf diff --git a/components/org.wso2.carbon.security.sts.common/src/main/java/org/wso2/carbon/identity/sts/common/identity/provider/AttributeCallbackHandler.java b/components/org.wso2.carbon.security.sts.common/src/main/java/org/wso2/carbon/identity/sts/common/identity/provider/AttributeCallbackHandler.java index c72fcfe9..3d3c2f2b 100644 --- a/components/org.wso2.carbon.security.sts.common/src/main/java/org/wso2/carbon/identity/sts/common/identity/provider/AttributeCallbackHandler.java +++ b/components/org.wso2.carbon.security.sts.common/src/main/java/org/wso2/carbon/identity/sts/common/identity/provider/AttributeCallbackHandler.java @@ -158,17 +158,19 @@ public void handle(SAMLCallback callback) throws SAMLException { StringUtils.isNotBlank(remoteClaimPrefixValue)) { // WS trust flow does not set the authenticated user property. if (isHandlerCalledFromWSTrustSTSFlow(attrCallback)) { - localClaimValue = IdentityProviderSTSServiceComponent.getRealmService(). - getBootstrapRealm().getUserStoreManager(). - getUserClaimValue(userIdentifier, localClaimUri, DEFAULT_PROFILE); + tenantDomain = getTenantDomainFromThreadLocalContext(); + UserRealm userRealm = IdentityTenantUtil.getRealm(tenantDomain, null); + localClaimValue = userRealm.getUserStoreManager().getUserClaimValue(userIdentifier, + localClaimUri, DEFAULT_PROFILE); } else if (!authenticatedUser.isFederatedUser()) { if (log.isDebugEnabled()) { log.debug("Loading claim values from local UserStore for user: " + authenticatedUser.toString()); } - localClaimValue = IdentityProviderSTSServiceComponent.getRealmService(). - getBootstrapRealm().getUserStoreManager(). - getUserClaimValue(userIdentifier, localClaimUri, DEFAULT_PROFILE); + tenantDomain = getTenantDomainFromThreadLocalContext(); + UserRealm userRealm = IdentityTenantUtil.getRealm(tenantDomain, null); + localClaimValue = userRealm.getUserStoreManager().getUserClaimValue(userIdentifier, + localClaimUri, DEFAULT_PROFILE); } if (StringUtils.isEmpty(localClaimValue)) { @@ -189,6 +191,8 @@ public void handle(SAMLCallback callback) throws SAMLException { throw new SAMLException("Error while loading SP specific claims", e); } catch (org.wso2.carbon.user.core.UserStoreException e) { throw new SAMLException("Error while loading claims of the user", e); + } catch (IdentityException e) { + throw new SAMLException("Error while loading claims", e); } } }