Ejemplo n.º 1
0
        /// <summary>
        /// Add the OPENID API.
        /// </summary>
        /// <param name="serviceCollection"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IServiceCollection AddOpenIdApi(this IServiceCollection serviceCollection, IdentityServerOptions options)
        {
            if (serviceCollection == null)
            {
                throw new ArgumentNullException(nameof(serviceCollection));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            ConfigureSimpleIdentityServer(
                serviceCollection,
                options);
            return(serviceCollection);
        }
 public static void UseOpenIdApi(this IApplicationBuilder app, IdentityServerOptions options, ILoggerFactory loggerFactory)
 {
     UseOpenIdApi(app, options);
 }
Ejemplo n.º 3
0
        public static IServiceCollection AddHostIdentityServer(this IServiceCollection serviceCollection, IdentityServerOptions options)
        {
            if (serviceCollection == null)
            {
                throw new ArgumentNullException(nameof(serviceCollection));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            serviceCollection
            .AddSingleton(options.Scim)
            .AddTransient <IRedirectInstructionParser, RedirectInstructionParser>()
            .AddTransient <IActionResultParser, ActionResultParser>()
            .AddSingleton <IHttpContextAccessor, HttpContextAccessor>()
            .AddSingleton <IActionContextAccessor, ActionContextAccessor>()
            .AddDataProtection();
            return(serviceCollection);
        }