mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-12-21 10:59:45 +08:00
重构SSO模块,抽离三种模式的统一认证中心
This commit is contained in:
@@ -13,7 +13,7 @@ public class SaSsoClientApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SaSsoClientApplication.class, args);
|
||||
System.out.println("\nSa-Token-SSO Client端启动成功");
|
||||
System.out.println("\nSa-Token SSO模式一 Client端启动成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,16 +15,14 @@ import cn.dev33.satoken.util.SaResult;
|
||||
@RestController
|
||||
public class SsoClientController {
|
||||
|
||||
/*
|
||||
* SSO-Client端:首页
|
||||
*/
|
||||
// SSO-Client端:首页
|
||||
@RequestMapping("/")
|
||||
public String index() {
|
||||
String authUrl = SaManager.getConfig().getSso().getAuthUrl();
|
||||
String solUrl = SaManager.getConfig().getSso().getSloUrl();
|
||||
String str = "<h2>Sa-Token SSO-Client 应用端</h2>" +
|
||||
"<p>当前会话是否登录:" + StpUtil.isLogin() + "</p>" +
|
||||
"<p><a href=\"javascript:location.href='" + authUrl + "?redirect=' + encodeURIComponent(location.href);\">登录</a> " +
|
||||
"<p><a href=\"javascript:location.href='" + authUrl + "?mode=simple&redirect=' + encodeURIComponent(location.href);\">登录</a> " +
|
||||
"<a href=\"javascript:location.href='" + solUrl + "?back=' + encodeURIComponent(location.href);\">注销</a> </p>";
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ server:
|
||||
sa-token:
|
||||
# SSO-相关配置
|
||||
sso:
|
||||
# SSO-Server端 单点登录地址
|
||||
# SSO-Server端-单点登录授权地址
|
||||
auth-url: http://sso.stp.com:9000/sso/auth
|
||||
# SSO-Server端 单点注销地址
|
||||
# SSO-Server端-单点注销地址
|
||||
slo-url: http://sso.stp.com:9000/sso/logout
|
||||
|
||||
# 配置Sa-Token单独使用的Redis连接 (此处需要和SSO-Server端连接同一个Redis)
|
||||
|
||||
Reference in New Issue
Block a user