From 0e2bc85cb89227eab9ec4f005c6fb7be0c59661d Mon Sep 17 00:00:00 2001 From: zhouhao Date: Sun, 11 Oct 2020 08:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96scope=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/oauth2/server/code/DefaultAuthorizationCodeGranter.java | 2 +- .../oauth2/server/code/DefaultAuthorizationCodeGranterTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hsweb-authorization/hsweb-authorization-oauth2/src/main/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranter.java b/hsweb-authorization/hsweb-authorization-oauth2/src/main/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranter.java index a8066145b..cd21aba29 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/src/main/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/src/main/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranter.java @@ -63,7 +63,7 @@ public class DefaultAuthorizationCodeGranter implements AuthorizationCodeGranter if (StringUtils.isEmpty(scopeStr)) { return ((permission, s) -> false); } - String[] scopes = scopeStr.split("[,]"); + String[] scopes = scopeStr.split("[ ,\n]"); Map> actions = new HashMap<>(); for (String scope : scopes) { String[] permissions = scope.split("[:]"); diff --git a/hsweb-authorization/hsweb-authorization-oauth2/src/test/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranterTest.java b/hsweb-authorization/hsweb-authorization-oauth2/src/test/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranterTest.java index 1f4487b2f..6fe99d62e 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/src/test/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranterTest.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/src/test/java/org/hswebframework/web/oauth2/server/code/DefaultAuthorizationCodeGranterTest.java @@ -19,7 +19,7 @@ public class DefaultAuthorizationCodeGranterTest { @Test public void testPermission() { - BiPredicate predicate = DefaultAuthorizationCodeGranter.createPredicate("user:info,device:query"); + BiPredicate predicate = DefaultAuthorizationCodeGranter.createPredicate("user:info device:query"); { SimplePermission permission=new SimplePermission();