use tenant resolving service
b447504f
Michael Schmitz
committed
succeeded
2 changed files
ServiceCollectionExtensions.cs
/WPE.App.Authentication.Maui/ServiceCollectionExtensions.cs-4+5
/WPE.App.Authentication.Maui/ServiceCollectionExtensions.cs
Add comment 1 using Infsoft.WPE.App.Authentication.Base;
Add comment 2 using Infsoft.WPE.App.Authentication.Base.Models;
Add comment 3 Plus  using Infsoft.WPE.App.Authentication.Base.Business;
Add comment 3 4 using Infsoft.WPE.App.Authentication.Maui.Business;
Add comment 4 5 using Infsoft.WPE.App.Authentication.Maui.Business.Flow;
Add comment 5 6 using Infsoft.WPE.App.Authentication.Maui.Business.Token;
Add comment 24 25 /// <param name="subscriptionKeyConfig">Allows tzhe configuration of hosts to set a subscriptionKey for</param>
Add comment 25 26 /// <returns>ServiceCollection to chain calls</returns>
Add comment 26 27 internal static IServiceCollection AddNativeAuthentication(this IServiceCollection services, Action<AuthenticationConfiguration> authConfig, Action<SubscriptionKeyConfiguration> subscriptionKeyConfig) =>
Add comment 27 Minus   services.AddNativeAuthentication<NativeAuthenticationStateProvider>(authConfig, subscriptionKeyConfig);
Add comment 28 Plus   services.AddNativeAuthentication<NoOpTenantResolver>(authConfig, subscriptionKeyConfig);
Add comment 28 29
Add comment 29 30 /// <summary>
Add comment 30 31 /// Add all required authentication services for a native login (using web authenticator) and the subscriptionKey handler
Add comment 31 32 /// </summary>
Add comment 32 Minus   /// <typeparam name="TAuthenticationStateProvider">Allows for a customized implementation</typeparam>
Add comment 33 Plus   /// <typeparam name="TTenantResolver">Allows for tenant code resolution</typeparam>
Add comment 33 34 /// <param name="services">Service collection to add to</param>
Add comment 34 35 /// <param name="authConfig">Allows the configuration of token request endpoints</param>
Add comment 35 36 /// <param name="subscriptionKeyConfig">Allows tzhe configuration of hosts to set a subscriptionKey for</param>
Add comment 36 37 /// <returns>ServiceCollection to chain calls</returns>
Add comment 37 Minus   internal static IServiceCollection AddNativeAuthentication<TAuthenticationStateProvider>(this IServiceCollection services, Action<AuthenticationConfiguration> authConfig, Action<SubscriptionKeyConfiguration> subscriptionKeyConfig) where TAuthenticationStateProvider : NativeAuthenticationStateProvider
Add comment 38 Plus   internal static IServiceCollection AddNativeAuthentication<TTenantResolver>(this IServiceCollection services, Action<AuthenticationConfiguration> authConfig, Action<SubscriptionKeyConfiguration> subscriptionKeyConfig) where TTenantResolver : class, ITenantResolver
Add comment 38 39 {
Add comment 39 40 services.AddOptions();
Add comment 40 41 services.AddAuthorizationCore();
Add comment 49 50 #endif
Add comment 50 51
Add comment 51 52 services.AddSingleton<IAuthClient, AuthClient>();
Add comment 52 Minus   services.AddBaseAuthentication<TAuthenticationStateProvider>();
Add comment 53 Plus   services.AddBaseAuthentication<NativeAuthenticationStateProvider, TTenantResolver>();
Add comment 53 54
Add comment 54 55 services.AddTransient<AuthorizationMessageHandler>();
Add comment 55 56 services.Configure(authConfig);
WPE.App.Authentication.Maui.csproj
/WPE.App.Authentication.Maui/WPE.App.Authentication.Maui.csproj-2+2
/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.3.4</Version>
Add comment 27 Plus   <Version>0.3.5</Version>
Add comment 28 <GenerateDocumentationFile>true</GenerateDocumentationFile>
Add comment 29 </PropertyGroup>
Add comment 30
Add comment 31 <ItemGroup>
Add comment 32 Minus   <PackageReference Include="Infsoft.WPE.App.Authentication.Base" Version="0.4.12" />
Add comment 32 Plus   <PackageReference Include="Infsoft.WPE.App.Authentication.Base" Version="0.5.0" />
Add comment 33 <PackageReference Include="Infsoft.WPE.App.DTO" Version="1.5.0" />
Add comment 34 <PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
Add comment 35 <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.6.1" />