Skip to content

Commit f8b5856

Browse files
authored
Merge pull request #48 from zlt2000/dev
修复oidc-sso样例工程的数据问题
2 parents f53ea2c + df1ce5a commit f8b5856

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

zlt-demo/sso-demo/oidc-sso/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ alter table oauth_client_details add support_id_token tinyint(1) DEFAULT 1 COMME
1111
alter table oauth_client_details add id_token_validity int(11) DEFAULT 60 COMMENT 'id_token有效期';
1212

1313
update oauth_client_details set additional_information = '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}'
14+
, web_server_redirect_uri = 'http://127.0.0.1:8082/callback.html'
1415
where client_id = 'webApp';
1516
```
1617

zlt-demo/sso-demo/oidc-sso/src/main/java/com/sso/demo/controller/ApiController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class ApiController {
5050
@Value("${zlt.sso.redirect-uri:}")
5151
private String redirectUri;
5252

53+
@Value("${zlt.sso.scope:}")
54+
private String scope;
55+
5356
@Value("${zlt.sso.access-token-uri:}")
5457
private String accessTokenUri;
5558

@@ -146,7 +149,7 @@ public Map<String, Object> getAccessToken(String code) {
146149
param.add("code", code);
147150
param.add("grant_type", "authorization_code");
148151
param.add("redirect_uri", redirectUri);
149-
param.add("scope", "all");
152+
param.add("scope", scope);
150153
param.add("nonce", this.genNonce());
151154
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(param, headers);
152155
ResponseEntity<Map> response = restTemplate.postForEntity(accessTokenUri, request , Map.class);

zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ zlt:
1111
client-secret: webApp
1212
redirect-uri: http://127.0.0.1:8082/callback.html
1313
access-token-uri: http://127.0.0.1:9900/api-uaa/oauth/token
14-
jwt-key-uri: http://127.0.0.1:9900/api-uaa/tokens/key
14+
jwt-key-uri: http://127.0.0.1:9900/api-uaa/tokens/key
15+
scope: app

zlt-doc/sql/oauth-center.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ CREATE TABLE `oauth_client_details` (
3030
-- ----------------------------
3131
-- Records of oauth_client_details
3232
-- ----------------------------
33-
INSERT INTO `oauth_client_details` VALUES (1, 'webApp', NULL, '$2a$10$06msMGYRH8nrm4iVnKFNKOoddB8wOwymVhbUzw/d3ZixD7Nq8ot72', 'webApp', 'app', 'authorization_code,password,refresh_token,client_credentials,implicit,password_code,openId,mobile_password', NULL, NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}', 'true', NULL, NULL, 'pc端', 1, 60);
33+
INSERT INTO `oauth_client_details` VALUES (1, 'webApp', NULL, '$2a$10$06msMGYRH8nrm4iVnKFNKOoddB8wOwymVhbUzw/d3ZixD7Nq8ot72', 'webApp', 'app', 'authorization_code,password,refresh_token,client_credentials,implicit,password_code,openId,mobile_password', 'http://127.0.0.1:8082/callback.html', NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}', 'true', NULL, NULL, 'pc端', 1, 60);
3434
INSERT INTO `oauth_client_details` VALUES (2, 'app', NULL, '$2a$10$i3F515wEDiB4Gvj9ym9Prui0dasRttEUQ9ink4Wpgb4zEDCAlV8zO', 'app', 'app', 'authorization_code,password,refresh_token', 'http://127.0.0.1:8081/callback.html', NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8081/logoutNotify"}', 'true', NULL, NULL, '移动端', 1, 60);
3535
INSERT INTO `oauth_client_details` VALUES (3, 'zlt', NULL, '$2a$10$/o.wuORzVcXaezmYVzwYMuoY7qeWXBALwQmkskXD/7C6rqfCyPrna', 'zlt', 'all', 'authorization_code,password,refresh_token,client_credentials', 'http://127.0.0.1:8080/singleLogin', NULL, 3600, 28800, '{}', 'true', '2018-12-27 00:50:30', '2018-12-27 00:50:30', '第三方应用', 1, 60);

0 commit comments

Comments
 (0)