fix: 通过apikey登陆使用local realm

This commit is contained in:
Captain.B 2021-01-13 14:13:15 +08:00
parent 9921489cc4
commit f8785d06ab
1 changed files with 2 additions and 2 deletions

View File

@ -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"));
} }
} }