Skip to content

Commit

Permalink
Get tenantDomain from CarbonContext instead of getting from the username
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyamSanthosh committed Jan 16, 2024
1 parent 137aff9 commit c211d0a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.DuplicatedAuthUserException;
import org.wso2.carbon.identity.application.authentication.framework.exception.UserIdNotFoundException;
import org.wso2.carbon.identity.application.authentication.framework.exception.UserSessionException;
Expand Down Expand Up @@ -164,7 +165,8 @@ public static AuthenticatedUser createLocalAuthenticatedUserFromSubjectIdentifie
authenticatedUser.setUserName(MultitenantUtils.getTenantAwareUsername(authenticatedSubjectIdentifier));
}

authenticatedUser.setTenantDomain(MultitenantUtils.getTenantDomain(authenticatedSubjectIdentifier));
String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
authenticatedUser.setTenantDomain(tenantDomain);
authenticatedUser.setAuthenticatedSubjectIdentifier(authenticatedSubjectIdentifier);
authenticatedUser.setUserId(authenticatedUser.getLocalUserIdInternal());

Expand Down

0 comments on commit c211d0a

Please sign in to comment.