Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d046b0

Browse files
committed
Made obtaining of access token and addition of AUTHORIZATION header conditional based on forward-signing.enabled configuration property
1 parent9564a1f commit1d046b0

File tree

1 file changed

+7
-2
lines changed
  • src/main/java/co/diligentsoft/auth/controller

1 file changed

+7
-2
lines changed

‎src/main/java/co/diligentsoft/auth/controller/Proxy.java‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public class Proxy {
5151
@Value("${api-auth-proxy.host}")
5252
privateStringselfHost;
5353

54+
@Value("${api-auth-proxy.forward-signing.enabled}")
55+
privatebooleanforwardSigningEnabled;
56+
5457
@Value("${api-auth-proxy.resource-protection.enabled}")
5558
privatebooleanresourceProtectionEnabled;
5659

@@ -99,8 +102,10 @@ private ResponseEntity<String> handleForwardProxyMode(RequestEntity request, Htt
99102
HttpHeadersnewHeaders =newHttpHeaders();
100103
newHeaders.add("X-Forwarded-For",servletRequest.getRemoteAddr());
101104

102-
finalStringaccessToken =getAccessToken().getValue();
103-
newHeaders.add(HttpHeaders.AUTHORIZATION,String.format("Bearer %s",accessToken));
105+
if (forwardSigningEnabled) {
106+
finalStringaccessToken =getAccessToken().getValue();
107+
newHeaders.add(HttpHeaders.AUTHORIZATION,String.format("Bearer %s",accessToken));
108+
}
104109

105110
finalRequestEntityforwardRequest =requestEntity(request,newHeaders,request.getUrl());
106111
returnrestTemplate.exchange(forwardRequest,String.class);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp