From 3db1d6fd42b94899126a2290b968411e695ba30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E6=9D=A5=E6=8A=80=E6=9C=AF?= <1490493387@qq.com> Date: Sun, 15 Aug 2021 01:17:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(ClientDetailsServiceImpl.java):=20OAuth2?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=9C=A8=E7=AE=A1=E7=90=86=E7=AB=AF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEaccess=5Ftoken=E6=9C=89=E6=95=88=E6=9C=9F?= =?UTF-8?q?=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/security/service/ClientDetailsServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youlai-auth/src/main/java/com/youlai/auth/security/service/ClientDetailsServiceImpl.java b/youlai-auth/src/main/java/com/youlai/auth/security/service/ClientDetailsServiceImpl.java index 76497189b..692fdc494 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/security/service/ClientDetailsServiceImpl.java +++ b/youlai-auth/src/main/java/com/youlai/auth/security/service/ClientDetailsServiceImpl.java @@ -1,4 +1,5 @@ package com.youlai.auth.security.service; + import com.youlai.admin.api.OAuthClientFeignClient; import com.youlai.admin.pojo.entity.SysOauthClient; import com.youlai.auth.common.enums.PasswordEncoderTypeEnum; @@ -32,8 +33,11 @@ public class ClientDetailsServiceImpl implements ClientDetailsService { client.getScope(), client.getAuthorizedGrantTypes(), client.getAuthorities(), - client.getWebServerRedirectUri()); + client.getWebServerRedirectUri() + ); clientDetails.setClientSecret(PasswordEncoderTypeEnum.NOOP.getPrefix() + client.getClientSecret()); + clientDetails.setAccessTokenValiditySeconds(client.getAccessTokenValidity()); + clientDetails.setRefreshTokenValiditySeconds(client.getRefreshTokenValidity()); return clientDetails; } else { throw new NoSuchClientException("No client with requested id: " + clientId);