-
-
Save explorer14/24a4571ee80c7bdd9c071590e38348e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IServiceCollection AddTraxpenseAuthentication( | |
this IServiceCollection services) | |
{ | |
// register the framework service for auth | |
services.AddAuthorizationCore(); | |
// register custom dependencies | |
services.AddSingleton<IClientTokenStorage, SessionTokenStorage>(); | |
services.AddScoped<AuthenticationStateProvider>( | |
serviceProvider => | |
new MyAuthenticationStateProvider( | |
serviceProvider.GetService<IAuthenticationService>(), | |
serviceProvider.GetService<IClientTokenStorage>())); | |
services.AddScoped<IAuthenticationService, AuthenticationService>(); | |
return services; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment