mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 13:34:18 +08:00
feat(sso): sso-server 新增 jumpToRedirectUrlNotice 策略,用于授权重定向跳转之前的通知
This commit is contained in:
parent
6f845fb6b8
commit
f150209a4f
@ -44,12 +44,12 @@ public class SaCheckTicketResult implements Serializable {
|
||||
/** 此账号会话剩余有效期 */
|
||||
public Long remainSessionTimeout;
|
||||
|
||||
/** 从 sso-server 返回的所有参数 */
|
||||
public SaResult result;
|
||||
|
||||
/** 此账号在认证中心的 loginId */
|
||||
public Object centerId;
|
||||
|
||||
/** 从 sso-server 返回的所有参数 */
|
||||
public SaResult result;
|
||||
|
||||
public SaCheckTicketResult() {
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ public class SaCheckTicketResult implements Serializable {
|
||||
", deviceId='" + deviceId + '\'' +
|
||||
", remainTokenTimeout=" + remainTokenTimeout +
|
||||
", remainSessionTimeout=" + remainSessionTimeout +
|
||||
", centerId=" + centerId +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ public class SaSsoServerProcessor {
|
||||
if(SaFoxUtil.isEmpty(cfg.getHomeRoute())) {
|
||||
throw new SaSsoException("未指定 redirect 参数,也未配置 homeRoute 路由,无法完成重定向操作").setCode(SaSsoErrorCode.CODE_30014);
|
||||
}
|
||||
ssoServerTemplate.strategy.jumpToRedirectUrlNotice.run(cfg.getHomeRoute());
|
||||
return res.redirect(cfg.getHomeRoute());
|
||||
}
|
||||
|
||||
@ -141,6 +142,7 @@ public class SaSsoServerProcessor {
|
||||
});
|
||||
|
||||
// 跳转
|
||||
ssoServerTemplate.strategy.jumpToRedirectUrlNotice.run(redirectUrl);
|
||||
return res.redirect(redirectUrl);
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
package cn.dev33.satoken.sso.strategy;
|
||||
|
||||
import cn.dev33.satoken.SaManager;
|
||||
import cn.dev33.satoken.fun.SaParamFunction;
|
||||
import cn.dev33.satoken.sso.function.CheckTicketAppendDataFunction;
|
||||
import cn.dev33.satoken.sso.function.DoLoginHandleFunction;
|
||||
import cn.dev33.satoken.sso.function.NotLoginViewFunction;
|
||||
@ -51,6 +52,13 @@ public class SaSsoServerStrategy {
|
||||
return SaResult.error();
|
||||
};
|
||||
|
||||
/**
|
||||
* SSO-Server端:在授权重定向之前的通知
|
||||
*/
|
||||
public SaParamFunction<String> jumpToRedirectUrlNotice = (redirectUrl) -> {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* SSO-Server端:在校验 ticket 后,给 sso-client 端追加返回信息的函数
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user