fix: 通过apikey登陆使用local realm
This commit is contained in:
parent
9921489cc4
commit
f8785d06ab
|
@ -22,12 +22,12 @@ public class ApiKeyFilter extends AnonymousFilter {
|
||||||
if (LogUtil.getLogger().isDebugEnabled()) {
|
if (LogUtil.getLogger().isDebugEnabled()) {
|
||||||
LogUtil.getLogger().debug("user auth: " + userId);
|
LogUtil.getLogger().debug("user auth: " + userId);
|
||||||
}
|
}
|
||||||
SecurityUtils.getSubject().login(new MsUserToken(userId, ApiKeySessionHandler.random, "APIKEY"));
|
SecurityUtils.getSubject().login(new MsUserToken(userId, ApiKeySessionHandler.random, "LOCAL"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ApiKeyHandler.isApiKeyCall(WebUtils.toHttp(request))) {
|
if (ApiKeyHandler.isApiKeyCall(WebUtils.toHttp(request))) {
|
||||||
String userId = ApiKeyHandler.getUser(WebUtils.toHttp(request));
|
String userId = ApiKeyHandler.getUser(WebUtils.toHttp(request));
|
||||||
SecurityUtils.getSubject().login(new MsUserToken(userId, ApiKeySessionHandler.random, "APIKEY"));
|
SecurityUtils.getSubject().login(new MsUserToken(userId, ApiKeySessionHandler.random, "LOCAL"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue