增加前后端分离的单点登录样例工程web-sso

This commit is contained in:
zlt
2020-03-14 17:48:35 +08:00
parent 658f4d651e
commit 91328ef6cc
19 changed files with 344 additions and 60 deletions
@@ -0,0 +1,23 @@
server:
port: 8080
spring:
application:
name: sso-demo
zlt:
api-uaa:
url: http://127.0.0.1:9900/api-uaa/oauth
logout-uri: ${zlt.api-uaa.url}/remove/token?redirect_uri=http://127.0.0.1:8080&access_token=
security:
oauth2:
sso:
login-path: /singleLogin
client:
client-id: zlt
client-secret: zlt
access-token-uri: ${zlt.api-uaa.url}/token
user-authorization-uri: ${zlt.api-uaa.url}/authorize
resource:
token-info-uri: ${zlt.api-uaa.url}/check_token
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta content="text/html;charset=UTF-8">
<title>SSO单点登录demo</title>
</head>
<body>
<div>
<p>登录者: <span th:text="${username}"></span></p>
<p>权限: <span th:text="${authorities}"></span></p>
<p>应用id: <span th:text="${clientId}"></span></p>
<p>token: <span th:text="${token}"></span></p>
<p><input type="button" value="登出" onclick="location='/logout'"/></p>
</div>
</body>
</html>