From 791e2a06bf9e11042e7a1af41728911fa1432b60 Mon Sep 17 00:00:00 2001 From: duqichang Date: Thu, 27 May 2021 10:17:02 +0800 Subject: [PATCH] =?UTF-8?q?[log]=20=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=97=A5=E5=BF=97=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/supermap/gaf/shiro/realms/JWTTokenRealm.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gaf-cloud/gaf-commons/gaf-common-auth/src/main/java/com/supermap/gaf/shiro/realms/JWTTokenRealm.java b/gaf-cloud/gaf-commons/gaf-common-auth/src/main/java/com/supermap/gaf/shiro/realms/JWTTokenRealm.java index 4f914d64..80975327 100644 --- a/gaf-cloud/gaf-commons/gaf-common-auth/src/main/java/com/supermap/gaf/shiro/realms/JWTTokenRealm.java +++ b/gaf-cloud/gaf-commons/gaf-common-auth/src/main/java/com/supermap/gaf/shiro/realms/JWTTokenRealm.java @@ -10,6 +10,7 @@ import com.supermap.gaf.shiro.JJWTUtils; import com.supermap.gaf.shiro.SecurityUtilsExt; import com.supermap.gaf.shiro.commontypes.JWTToken; import io.buji.pac4j.subject.Pac4jPrincipal; +import lombok.extern.slf4j.Slf4j; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; @@ -31,6 +32,7 @@ import java.util.Set; * @author:yj * @date:2021/3/25 */ +@Slf4j public class JWTTokenRealm extends AuthorizingRealm { private final IauthUserInfoDetails iauthUserInfoDetails; @@ -66,7 +68,9 @@ public class JWTTokenRealm extends AuthorizingRealm { final Pac4jPrincipal principal = new Pac4jPrincipal(Arrays.asList(new CommonProfile[] { profile })); return new SimpleAuthenticationInfo(principal, Boolean.TRUE, getName()); } catch (Exception e) { - throw new AuthenticationException("JWT 解析异常:"); + log.error("获取用户信息失败"); + e.printStackTrace(); + throw new AuthenticationException("获取用户信息失败:"); } } -- Gitee