增加前后端分离的单点登录样例工程web-sso
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user