Skip to content

Commit

Permalink
VCST-114: add proxy for /token endpoints (#673)
Browse files Browse the repository at this point in the history
Co-authored-by: Elena Mutykova <56412054+Lenajava1@users.noreply.github.com>
  • Loading branch information
ksavosteev and Lenajava1 committed Mar 1, 2024
1 parent f462409 commit a6af167
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage

protected override async Task AddAuthenticationAsync(HttpRequestMessage request)
{
if (!request.Headers.Contains("Authorization") && !request.RequestUri.AbsoluteUri.Contains("/connect/token"))
if (!request.Headers.Contains("Authorization") && !request.RequestUri.AbsoluteUri.EndsWith("/token"))
{
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", await GetOrRenewTokenAsync());
}
Expand Down
2 changes: 1 addition & 1 deletion VirtoCommerce.Storefront/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}));

app.UseWhen(
context => context.Request.Path.Value.EndsWith("connect/token"),
context => context.Request.Path.Value.EndsWith("/token"),
appInner => appInner
.RunProxy(context => context
.ForwardTo(platformEndpointOptions.Url)
Expand Down

0 comments on commit a6af167

Please sign in to comment.