sa-token/sa-token-demo/sa-token-demo-sso3-server/src/main/java/com/pj/sso/SsoServerLogoutController.java
2021-06-29 23:32:35 +08:00

29 lines
694 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.pj.sso;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ejlchina.okhttps.OkHttps;
import cn.dev33.satoken.sso.SaSsoUtil;
/**
* Sa-Token-SSO Server端 单点注销 Controller
* @author kong
*/
@RestController
public class SsoServerLogoutController {
// SSO-Server端单点注销
@RequestMapping("ssoLogout")
public String ssoLogout(String loginId, String secretkey) {
// 遍历通知Client端注销会话 (为了提高响应速度这里可将sync换为async)
SaSsoUtil.singleLogout(secretkey, loginId, url -> OkHttps.sync(url).get());
// 完成
return "ok";
}
}