// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Identity;
namespace Microsoft.AspNet.Builder
{
///
/// Identity extensions for .
///
public static class BuilderExtensions
{
///
/// Enables the ASP.NET identity for the current application.
///
/// The instance this method extends.
/// The instance this method extends.
public static IApplicationBuilder UseIdentity(this IApplicationBuilder app)
{
if (app == null)
{
throw new ArgumentNullException("app");
}
app.UseCookieAuthentication(null, IdentityOptions.ExternalCookieAuthenticationScheme);
app.UseCookieAuthentication(null, IdentityOptions.TwoFactorRememberMeCookieAuthenticationScheme);
app.UseCookieAuthentication(null, IdentityOptions.TwoFactorUserIdCookieAuthenticationScheme);
app.UseCookieAuthentication(null, IdentityOptions.ApplicationCookieAuthenticationScheme);
return app;
}
}
}