public void Configuration(IAppBuilder app) { app.Use(); app.Use (); }
public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = "ApplicationCookie", LoginPath = new PathString("/Account/Login") }); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); app.UseOAuthBearerTokens(new OAuthAuthorizationServerOptions { Provider = new MyOAuthAuthorizationServerProvider(), AccessTokenExpireTimeSpan = TimeSpan.FromDays(1), AllowInsecureHttp = true }); }This code configures different types of authentication and authorization: `CookieAuthentication` provides a scheme for user authentication using cookies, `ExternalSignInCookie` is used to authenticate external logins (e.g., from social networks), and `OAuthBearerTokens` sets up an OAuth2.0 authorization server that issues access tokens for API access. Package library: Microsoft.Owin.