Ejemplo n.º 1
0
 public OpenIdConnectRedirectProvider(IMetadataService metadataService, NavigationManager navigationManager, OpenIdConnectMetadataConfigurationOptions options, ITokenProvider tokenProvider)
 {
     this.metadataService   = metadataService;
     this.navigationManager = navigationManager;
     this.options           = options;
     this.tokenProvider     = tokenProvider;
 }
Ejemplo n.º 2
0
        public static IServiceCollection UseOpenIdConnectAuthentication(this IServiceCollection services, string oidcServer, string clientId, string redirectPath, params string[] scopes)
        {
            var options = new OpenIdConnectMetadataConfigurationOptions($"{oidcServer}/.well-known/openid-configuration", clientId, redirectPath, scopes);

            services.AddSingleton(options);

            services.AddSingleton <IMetadataService, OpenIdConnectMetadataService>();
            services.AddSingleton <ITokenProvider, DefaultTokenProvider>();
            services.AddSingleton <OpenIdConnectRedirectProvider>();
            services.AddScoped <AuthenticationStateProvider, OpenIdConnectAuthenticationStateProvider>();

            return(services);
        }
Ejemplo n.º 3
0
 public OpenIdConnectMetadataService(HttpClient client, OpenIdConnectMetadataConfigurationOptions options)
 {
     this.client  = client;
     this.options = options;
 }