April 2017
Intermediate to advanced
564 pages
24h 7m
English
To use OpenID Connect Provider (OP), we need to add the middleware to our application's HTTP pipeline, so that unauthorized requests can be forwarded to the authorization server for user authentication.
Add cookie middleware and OIDC middleware as follows:
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = "Cookies" }); app.UseOpenIdConnectAuthentication( new OpenIdConnectOptions { AuthenticationScheme = "oidc", ClientId = "client", Authority = "http://localhost:5000", RequireHttpsMetadata = false, SignInScheme = "Cookies", Scope = {"openid", "profile", "roles" }, SaveTokens = true });
Read now
Unlock full access