有没有办法在 Websphere 9.0 上从 Spring boot 运行 触发身份验证
Is there a way to trigger authentication from Spring boot running on Websphere 9.0
我在 Websphere 9.0 上部署了一个简单的 Spring Boot REST api。
这个 API 有一个登录端点,应该触发 Websphere 中的身份验证流程。
当我使用基本身份验证并在 SecurityConfig 中指定 jee() 标记时,一切正常。甚至角色也被正确映射。因此 preAuthentication 部分正在工作。但是我想使用我的自定义登录端点而不是基本身份验证。
例如:
POST /auth/login
{“用户名”:“某事”,“密码”:“某事”}
我已经尝试调用
import javax.http.HttpServletRequest;
...
@PostMapping("/auth/login")
public void login(HttpServletRequest request) throws ServletException {
request.login("something", "something");
}
...
但这会触发 DaoAuthenticationProvider 而不是 Websphere 本身内的身份验证提供程序。
如有任何帮助,我们将不胜感激。我在这里错过了什么?
是的,有办法:
import com.ibm.ws.webcontainer.srt.SRTServletRequest;
@PostMapping("/auth/login")
public void login(SRTServletRequest request) throws ServletException {
request.login("something", "something");
}
我在 Websphere 9.0 上部署了一个简单的 Spring Boot REST api。
这个 API 有一个登录端点,应该触发 Websphere 中的身份验证流程。
当我使用基本身份验证并在 SecurityConfig 中指定 jee() 标记时,一切正常。甚至角色也被正确映射。因此 preAuthentication 部分正在工作。但是我想使用我的自定义登录端点而不是基本身份验证。
例如:
POST /auth/login {“用户名”:“某事”,“密码”:“某事”}
我已经尝试调用
import javax.http.HttpServletRequest;
...
@PostMapping("/auth/login")
public void login(HttpServletRequest request) throws ServletException {
request.login("something", "something");
}
...
但这会触发 DaoAuthenticationProvider 而不是 Websphere 本身内的身份验证提供程序。
如有任何帮助,我们将不胜感激。我在这里错过了什么?
是的,有办法:
import com.ibm.ws.webcontainer.srt.SRTServletRequest;
@PostMapping("/auth/login")
public void login(SRTServletRequest request) throws ServletException {
request.login("something", "something");
}