Closed SpringStudent closed 6 years ago
为什么要这么考虑,使用出场景是什么?
为了做前后端分离或者说我们有客户端给客户端开登陆接口
单点登录的情况下做前后端分离都是比较牵强的,没有找到一个很好的方案,目前方法可以采用rest在客户端进行调用,jwt在业务系统生成
嗯,我目前的做法是开一个接口返回tgt实现,另外一个接口根据tgt和serviceId生成st,然后客户端或者浏览器铜鼓serviceId?ticket=st的方法
不然只有改源码,rest接口模拟cas登录
无需那么复杂,cas支持rest对接 官方文档地址:https://apereo.github.io/cas/5.1.x/protocol/REST-Protocol.html 客户端cas-client也支持这样的做法,而spring-security应该也是支持的,但我没尝试过
如果是webservice方式的登录接口呢?
webservice只是业务系统对外开放的一种方式,跟cas无关,只要对接上了cas。以什么方式都是一样
嗯,我已经实现了
感谢
@RestController @RequestMapping("/rest/") public class LoginController{
}
public class LoginParam { /**
密码 */ private String password;
public String getUsername() { return username; }
public void setUsername(String username) { this.username = username; }
public String getPassword() { return password; }
public void setPassword(String password) { this.password = password; } }
如上代码,我的接口是自己定义,登录入参也是自定义,请问怎么实现