本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
});
}
示例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);
}
示例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);
});
}
示例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);
}
示例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);
});
}
示例9: DefaultTokenService
public DefaultTokenService(IdentityServerOptions options, IClaimsProvider claimsProvider, ITokenHandleStore tokenHandles, ITokenSigningService signingService)
{
_options = options;
_claimsProvider = claimsProvider;
_tokenHandles = tokenHandles;
_signingService = signingService;
}
示例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);
});
}
示例11: TokenValidator
public TokenValidator(IdentityServerOptions options, IClientStore clients, ITokenHandleStore tokenHandles, ICustomTokenValidator customValidator)
{
_options = options;
_clients = clients;
_tokenHandles = tokenHandles;
_customValidator = customValidator;
}
示例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);
});
}
示例13: AccessTokenValidationController
public AccessTokenValidationController(TokenValidator validator, IdentityServerOptions options, ILocalizationService localizationService, IEventService events)
{
_validator = validator;
_options = options;
_localizationService = localizationService;
_events = events;
}
示例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;
}
示例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;
}