當前位置: 首頁>>代碼示例>>C#>>正文


C# Configuration.IdentityServerOptions類代碼示例

本文整理匯總了C#中Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions的典型用法代碼示例。如果您正苦於以下問題:C# IdentityServerOptions類的具體用法?C# IdentityServerOptions怎麽用?C# IdentityServerOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IdentityServerOptions類屬於Thinktecture.IdentityServer.Core.Configuration命名空間,在下文中一共展示了IdentityServerOptions類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateAuthorizeValidator

        public static AuthorizeRequestValidator CreateAuthorizeValidator(
            IdentityServerOptions options = null,
            IScopeStore scopes = null,
            IClientStore clients = null,
            IUserService users = null,
            ICustomRequestValidator customValidator = null)
        {
            if (options == null)
            {
                options = Thinktecture.IdentityServer.Tests.TestIdentityServerOptions.Create();
            }

            if (scopes == null)
            {
                scopes = new InMemoryScopeStore(TestScopes.Get());
            }

            if (clients == null)
            {
                clients = new InMemoryClientStore(TestClients.Get());
            }

            if (customValidator == null)
            {
                customValidator = new DefaultCustomRequestValidator();
            }

            return new AuthorizeRequestValidator(options, scopes, clients, customValidator);
        }
開發者ID:JaiChaturvedi,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:29,代碼來源:ValidatorFactory.cs

示例2: UserInfoEndpointController

 /// <summary>
 /// Initializes a new instance of the <see cref="UserInfoEndpointController"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <param name="tokenValidator">The token validator.</param>
 /// <param name="generator">The generator.</param>
 /// <param name="tokenUsageValidator">The token usage validator.</param>
 public UserInfoEndpointController(IdentityServerOptions options, TokenValidator tokenValidator, UserInfoResponseGenerator generator, BearerTokenUsageValidator tokenUsageValidator)
 {
     _tokenValidator = tokenValidator;
     _generator = generator;
     _options = options;
     _tokenUsageValidator = tokenUsageValidator;
 }
開發者ID:Lawrence2013,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:14,代碼來源:UserInfoEndpointController.cs

示例3: AuthenticationController

 public AuthenticationController(
     OwinEnvironmentService owin,
     IViewService viewService, 
     IUserService userService, 
     IdentityServerOptions idSvrOptions, 
     IClientStore clientStore, 
     IEventService eventService,
     ILocalizationService localizationService,
     SessionCookie sessionCookie, 
     MessageCookie<SignInMessage> signInMessageCookie,
     MessageCookie<SignOutMessage> signOutMessageCookie,
     LastUserNameCookie lastUsernameCookie,
     AntiForgeryToken antiForgeryToken)
 {
     this.context = new OwinContext(owin.Environment);
     this.viewService = viewService;
     this.userService = userService;
     this.options = idSvrOptions;
     this.clientStore = clientStore;
     this.eventService = eventService;
     this.localizationService = localizationService;
     this.sessionCookie = sessionCookie;
     this.signInMessageCookie = signInMessageCookie;
     this.signOutMessageCookie = signOutMessageCookie;
     this.lastUsernameCookie = lastUsernameCookie;
     this.antiForgeryToken = antiForgeryToken;
 }
開發者ID:nmeierpolys,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:27,代碼來源:AuthenticationController.cs

示例4: Configuration

        public void Configuration(IAppBuilder app)
        {
            app.Map("/admin", adminApp =>
            {
                var factory = new IdentityManagerServiceFactory();
                factory.ConfigureSimpleIdentityManagerService("AspId");

                adminApp.UseIdentityManager(new IdentityManagerOptions()
                {
                    Factory = factory
                });
            });
            app.Map("/core", core =>
            {
                var idSvrFactory = Factory.Configure();
                idSvrFactory.ConfigureUserService("AspId");

                var options = new IdentityServerOptions
                {
                    SiteName = "Thinktecture IdentityServer3 - AspNetIdentity 2FA",
                    SigningCertificate = Certificate.Get(),
                    Factory = idSvrFactory,
                };

                core.UseIdentityServer(options);
            });
        }
開發者ID:MauricioArroyo,項目名稱:IdentityServer3.Samples,代碼行數:27,代碼來源:Startup.cs

示例5: Configuration

        public void Configuration(IAppBuilder app)
        {
            app.Map("/admin", adminApp =>
            {
                var factory = new IdentityManagerServiceFactory();
                factory.ConfigureSimpleIdentityManagerService("AspId");
                //factory.ConfigureCustomIdentityManagerServiceWithIntKeys("AspId_CustomPK");

                adminApp.UseIdentityManager(new IdentityManagerOptions()
                {
                    Factory = factory
                });
            });

            var idSvrFactory = Factory.Configure();
            idSvrFactory.ConfigureUserService("AspId");
            //idSvrFactory.ConfigureCustomUserService("AspId_CustomPK");

            var options = new IdentityServerOptions
            {
                SiteName = "Thinktecture IdentityServer3 - UserService-AspNetIdentity",
                SigningCertificate = Certificate.Get(),
                Factory = idSvrFactory,
                CorsPolicy = CorsPolicy.AllowAll,
                AuthenticationOptions = new AuthenticationOptions
                {
                    IdentityProviders = ConfigureAdditionalIdentityProviders,
                }
            };

            app.UseIdentityServer(options);
        }
開發者ID:MauricioArroyo,項目名稱:IdentityServer3.Samples,代碼行數:32,代碼來源:Startup.cs

示例6: Configuration

        public void Configuration(IAppBuilder app)
        {
            LogProvider.SetCurrentLogProvider(new DiagnosticsTraceLogProvider());

            app.Map("/idsrv", idSrvApp =>
            {
                var factory = InMemoryFactory.Create(
                    users: Users.Get(),
                    clients: Clients.Get(),
                    scopes: Scopes.Get());

                factory.ConfigureClientStoreCache();
                factory.ConfigureScopeStoreCache();
                factory.ConfigureUserServiceCache();

                var idsrvOptions = new IdentityServerOptions
                {
                    SiteName = "ACME Identity Server",
                    IssuerUri = "https://idsrv.acme.com",
                    Factory = factory,
                    SigningCertificate = Cert.Load(),

                    CorsPolicy = CorsPolicy.AllowAll,
                };

                idSrvApp.UseIdentityServer(idsrvOptions);
            });
        }
開發者ID:ChristianWeyer,項目名稱:myProducts-End-to-End,代碼行數:28,代碼來源:IdentityServerStartup.cs

示例7: Configuration

        public void Configuration(IAppBuilder app)
        {
            var connString = "AspId";
            //var connString = "CustomAspId";

            app.Map("/admin", adminApp =>
            {
                var factory = new AspNetIdentityIdentityManagerFactory(connString);
                adminApp.UseIdentityManager(new IdentityManagerConfiguration()
                {
                    IdentityManagerFactory = factory.Create
                });
            });

            var options = new IdentityServerOptions
            {
                IssuerUri = "https://idsrv3.com",
                SiteName = "Thinktecture IdentityServer v3 - UserService-AspNetIdentity",
                PublicHostName = "http://localhost:3333",

                SigningCertificate = Certificate.Get(),
                Factory = Factory.Configure(connString),
                CorsPolicy = CorsPolicy.AllowAll
            };

            app.UseIdentityServer(options);
        }
開發者ID:cb55555,項目名稱:Thinktecture.IdentityServer.v3.AspNetIdentity,代碼行數:27,代碼來源:Startup.cs

示例8: Configuration

        public void Configuration(IAppBuilder app)
        {
            app.Map("/core", coreApp =>
            {
                var factory = InMemoryFactory.Create(
                    users:   Users.Get(),
                    clients: Clients.Get(),
                    scopes:  Scopes.Get());

                var viewOptions = new DefaultViewServiceOptions();
                viewOptions.Stylesheets.Add("/Content/Site.css");
                viewOptions.CacheViews = false;
                factory.ConfigureDefaultViewService(viewOptions);

                var options = new IdentityServerOptions
                {
                    SiteName = "Thinktecture IdentityServer3 - Configuring DefaultViewService",

                    SigningCertificate = Certificate.Get(),
                    Factory = factory,
                    CorsPolicy = CorsPolicy.AllowAll,

                    AuthenticationOptions = new AuthenticationOptions{
                        IdentityProviders = ConfigureAdditionalIdentityProviders,
                    }
                };

                coreApp.UseIdentityServer(options);
            });
        }
開發者ID:MauricioArroyo,項目名稱:IdentityServer3.Samples,代碼行數:30,代碼來源:Startup.cs

示例9: DefaultTokenService

 public DefaultTokenService(IdentityServerOptions options, IClaimsProvider claimsProvider, ITokenHandleStore tokenHandles, ITokenSigningService signingService)
 {
     _options = options;
     _claimsProvider = claimsProvider;
     _tokenHandles = tokenHandles;
     _signingService = signingService;
 }
開發者ID:JaiChaturvedi,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:7,代碼來源:DefaultTokenService.cs

示例10: Configuration

        public void Configuration(IAppBuilder app)
        {
            LogProvider.SetCurrentLogProvider(new DiagnosticsTraceLogProvider());

            app.Map("/core", coreApp =>
            {
                var factory = InMemoryFactory.Create(
                    users : Users.Get(),
                    clients: Clients.Get(),
                    scopes: Scopes.Get());

                factory.ViewService = new Registration<IViewService>(typeof(CustomViewService));
                //factory.UserService = new Registration<IUserService, UserService>();

                var options = new IdentityServerOptions
                {
                    IssuerUri = "https://idsrv3.com",
                    SiteName = "Thinktecture IdentityServer3 - CustomViewService",

                    SigningCertificate = Certificate.Get(),
                    Factory = factory,
                    CorsPolicy = CorsPolicy.AllowAll,
                    AuthenticationOptions = new AuthenticationOptions {
                        IdentityProviders = ConfigureAdditionalIdentityProviders,
                    }
                };

                coreApp.UseIdentityServer(options);
            });
        }
開發者ID:MauricioArroyo,項目名稱:IdentityServer3.Samples,代碼行數:30,代碼來源:Startup.cs

示例11: TokenValidator

 public TokenValidator(IdentityServerOptions options, IClientStore clients, ITokenHandleStore tokenHandles, ICustomTokenValidator customValidator)
 {
     _options = options;
     _clients = clients;
     _tokenHandles = tokenHandles;
     _customValidator = customValidator;
 }
開發者ID:Lawrence2013,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:7,代碼來源:TokenValidator.cs

示例12: Configuration

        public void Configuration(IAppBuilder app)
        {
            LogProvider.SetCurrentLogProvider(new DiagnosticsTraceLogProvider());

            // uncomment to enable HSTS headers for the host
            // see: https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security
            //app.UseHsts();

            app.Map("/core", coreApp =>
                {
                    var factory = Factory.Create();

                    var idsrvOptions = new IdentityServerOptions
                    {
                        IssuerUri = "https://idsrv3.com",
                        SiteName = "Thinktecture IdentityServer v3 - preview 1",
                        SigningCertificate = Cert.Load(),
                        CspReportEndpoint = EndpointSettings.Enabled,
                        AccessTokenValidationEndpoint = EndpointSettings.Enabled,
                        PublicHostName = "http://localhost:3333",
                        Factory = factory,
                        AdditionalIdentityProviderConfiguration = ConfigureAdditionalIdentityProviders,
                        CorsPolicy = CorsPolicy.AllowAll
                    };
                    coreApp.UseIdentityServer(idsrvOptions);
                });
        }
開發者ID:Wolfium,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:27,代碼來源:Startup_LocalTest.cs

示例13: AccessTokenValidationController

 public AccessTokenValidationController(TokenValidator validator, IdentityServerOptions options, ILocalizationService localizationService, IEventService events)
 {
     _validator = validator;
     _options = options;
     _localizationService = localizationService;
     _events = events;
 }
開發者ID:ridopark,項目名稱:IdentityServer3,代碼行數:7,代碼來源:AccessTokenValidationController.cs

示例14: TokenEndpointController

 /// <summary>
 /// Initializes a new instance of the <see cref="TokenEndpointController"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <param name="requestValidator">The request validator.</param>
 /// <param name="clientValidator">The client validator.</param>
 /// <param name="generator">The generator.</param>
 public TokenEndpointController(IdentityServerOptions options, TokenRequestValidator requestValidator, ClientValidator clientValidator, TokenResponseGenerator generator)
 {
     _requestValidator = requestValidator;
     _clientValidator = clientValidator;
     _generator = generator;
     _options = options;
 }
開發者ID:Lawrence2013,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:14,代碼來源:TokenEndpointController.cs

示例15: GetRedirectUrl

        public static string GetRedirectUrl(SignInMessage message, IDictionary<string, object> env, IdentityServerOptions options)
        {
            var result = new LoginResult(message, env, options);
            var response = result.Execute();

            return response.Headers.Location.AbsoluteUri;
        }
開發者ID:Lawrence2013,項目名稱:Thinktecture.IdentityServer.v3,代碼行數:7,代碼來源:LoginResult.cs


注:本文中的Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。