mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Removed tenant domain from Basic Authenticator
This commit is contained in:
parent
4128e2d355
commit
e29aa58e19
@ -28,6 +28,7 @@ import org.apache.tomcat.util.buf.CharChunk;
|
||||
import org.apache.tomcat.util.buf.MessageBytes;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
import org.wso2.carbon.user.api.UserStoreManager;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
import org.wso2.carbon.webapp.authenticator.framework.AuthenticationException;
|
||||
import org.wso2.carbon.webapp.authenticator.framework.AuthenticatorFrameworkDataHolder;
|
||||
import org.wso2.carbon.webapp.authenticator.framework.Constants;
|
||||
@ -68,7 +69,8 @@ public class BasicAuthAuthenticator implements WebappAuthenticator {
|
||||
int tenantId = Utils.getTenantIdOFUser(credentials.getUsername());
|
||||
UserStoreManager userStore = AuthenticatorFrameworkDataHolder.getInstance().getRealmService().
|
||||
getTenantUserRealm(tenantId).getUserStoreManager();
|
||||
boolean authenticated = userStore.authenticate(credentials.getUsername(), credentials.getPassword());
|
||||
String username = MultitenantUtils.getTenantAwareUsername(credentials.getUsername());
|
||||
boolean authenticated = userStore.authenticate(username, credentials.getPassword());
|
||||
if (authenticated) {
|
||||
authenticationInfo.setStatus(Status.CONTINUE);
|
||||
authenticationInfo.setUsername(credentials.getUsername());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user