This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Add a help extensions for setting up OIDC with Cookie sign in #1212
Closed
Description
To setup OIDC with cookie sign in you have to do three things: 1. add OIDC, 2. add Cookies, 3. configure default auth schemes. We should add an help extension that does these three things for you.
Currently we have this code in the template that we should replace with an API in the framework:
public static IServiceCollection AddWebApplicationAuthentication(this IServiceCollection services)
{
services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
sharedOptions.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
});
services.AddOpenIdConnectAuthentication();
services.AddCookieAuthentication();
return services;
}
Alternative names: AddOpenIdConnectWithCookies
, AddOpenIdConnectWithCookieSignIn
, AddDefaultOpenIdConnectAuthentication
, ...