【单点登录】未找到用户处理

This commit is contained in:
huangweixiong 2022-06-03 18:05:06 +08:00
parent 95e59c82f4
commit c283299fc8
1 changed files with 2 additions and 8 deletions

View File

@ -104,14 +104,6 @@ public class Oauth2Filter extends AuthenticatingFilter {
return false;
}
private String getYaweiUserIdCookieInResponse(HttpServletResponse response) {
String userIdKey = "UserID=";
for (String header : response.getHeaders("set-cookie")) {
if (header.startsWith(userIdKey)) return header.substring(userIdKey.length());
}
return null;
}
@Override
protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) {
try {
@ -233,6 +225,8 @@ public class Oauth2Filter extends AuthenticatingFilter {
request.setAttribute(Constant.TOKEN_HEADER, currentToken);
return executeLogin(request, response);
}else {
send401Error(response, "未找到相关用户");
}
}
}