Skip to content

Commit a6af167

Browse files
VCST-114: add proxy for /token endpoints (#673)
Co-authored-by: Elena Mutykova <56412054+Lenajava1@users.noreply.github.com>
1 parent f462409 commit a6af167

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

VirtoCommerce.Storefront/Infrastructure/Autorest/UserPasswordAuthHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
6767

6868
protected override async Task AddAuthenticationAsync(HttpRequestMessage request)
6969
{
70-
if (!request.Headers.Contains("Authorization") && !request.RequestUri.AbsoluteUri.Contains("/connect/token"))
70+
if (!request.Headers.Contains("Authorization") && !request.RequestUri.AbsoluteUri.EndsWith("/token"))
7171
{
7272
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", await GetOrRenewTokenAsync());
7373
}

VirtoCommerce.Storefront/Startup.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
439439
}));
440440

441441
app.UseWhen(
442-
context => context.Request.Path.Value.EndsWith("connect/token"),
442+
context => context.Request.Path.Value.EndsWith("/token"),
443443
appInner => appInner
444444
.RunProxy(context => context
445445
.ForwardTo(platformEndpointOptions.Url)

0 commit comments

Comments
 (0)