fix subscriptionKey handler
514cae2d
Michael Schmitz
committed
succeeded
3 changed files
SubscriptionKeyHandler.cs
/WPE.App.Authentication.Maui/Business/SubscriptionKeyHandler.cs-1+2
/WPE.App.Authentication.Maui/Business/SubscriptionKeyHandler.cs
Add comment 8 /// <inheritdoc />
Add comment 9 protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Add comment 10 {
Add comment 11 Minus   if (request.RequestUri?.Host == Options.Value.Host)
Add comment 11 Plus   // do not write header if it is already set
Add comment 12 Plus   if (request.RequestUri?.Host == Options.Value.Host && !request.Headers.Contains(Options.Value.Header))
Add comment 12 13 request.Headers.Add(Options.Value.Header, Options.Value.Key);
Add comment 13 14
Add comment 14 15 return base.SendAsync(request, cancellationToken);
ServiceCollectionExtensions.cs
/WPE.App.Authentication.Maui/ServiceCollectionExtensions.cs-3+2
/WPE.App.Authentication.Maui/ServiceCollectionExtensions.cs
Add comment 5 using Infsoft.WPE.App.Authentication.Maui.Business.Token;
Add comment 6 using Infsoft.WPE.App.Authentication.Maui.Models;
Add comment 7 using Microsoft.Extensions.Http;
Add comment 8 Minus  using Microsoft.Maui.Controls;
Add comment 9 8 #if WINDOWS
Add comment 10 9 using Infsoft.WPE.App.Authentication.Maui.Platforms.Windows;
Add comment 11 10 #endif
Add comment 41 40 services.AddSingleton<IAuthClient, AuthClient>();
Add comment 42 41 services.AddBaseAuthentication<NativeAuthenticationStateProvider>();
Add comment 43 42
Add comment 43 Plus   services.AddTransient<AuthorizationMessageHandler>();
Add comment 44 services.Configure(authConfig);
Add comment 45 Minus  
Add comment 46 Minus   services.AddTransient<AuthorizationMessageHandler>();
Add comment 47 45 services.ConfigureAll<HttpClientFactoryOptions>(options =>
Add comment 48 46 {
Add comment 49 47 options.HttpMessageHandlerBuilderActions.Add(builder =>
Add comment 53 51 });
Add comment 54 52 });
Add comment 55 53
Add comment 54 Plus   services.AddTransient<SubscriptionKeyHandler>();
Add comment 56 55 services.Configure(subscriptionKeyConfig);
Add comment 57 56 services.ConfigureAll<HttpClientFactoryOptions>(options =>
Add comment 58 57 {
WPE.App.Authentication.Maui.csproj
/WPE.App.Authentication.Maui/WPE.App.Authentication.Maui.csproj-1+1
/WPE.App.Authentication.Maui/WPE.App.Authentication.Maui.csproj
Add comment 24 <PackageIcon>icon.png</PackageIcon>
Add comment 25 <PackageReadmeFile>ReadMe.md</PackageReadmeFile>
Add comment 26 <PackageTags>WPE;Workplace Experience;infsoft</PackageTags>
Add comment 27 Minus   <Version>0.1.0-next09</Version>
Add comment 27 Plus   <Version>0.1.0-next10</Version>
Add comment 28 <GenerateDocumentationFile>true</GenerateDocumentationFile>
Add comment 29 </PropertyGroup>
Add comment 30