From e21ea99dabfd815a82d8866bd1d4a011eb38d40b Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 20 Jun 2023 10:26:19 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20=E5=9B=9E=E9=80=80apikeyfilter?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/security/ApiKeyFilter.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/security/ApiKeyFilter.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/security/ApiKeyFilter.java index e05085fd36..491d521483 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/security/ApiKeyFilter.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/security/ApiKeyFilter.java @@ -20,12 +20,9 @@ public class ApiKeyFilter extends AnonymousFilter { // 不是apikey的通过 if (!ApiKeyHandler.isApiKeyCall(httpRequest) && !SecurityUtils.getSubject().isAuthenticated()) { // sso 带了token的 - String token = httpRequest.getHeader(SessionConstants.SSO_TOKEN); - if (StringUtils.isNotBlank(token)) { - String userId = SSOSessionHandler.validate(httpRequest); - if (StringUtils.isNotBlank(userId)) { - SecurityUtils.getSubject().login(new UsernamePasswordToken(userId, SSOSessionHandler.random)); - } + String userId = SSOSessionHandler.validate(httpRequest); + if (StringUtils.isNotBlank(userId)) { + SecurityUtils.getSubject().login(new UsernamePasswordToken(userId, SSOSessionHandler.random)); } return true; }