// Copyright (c) .NET Foundation. 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.Authentication; namespace Microsoft.Extensions.DependencyInjection { public static class AuthenticationServiceCollectionExtensions { public static IServiceCollection AddAuthentication(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddWebEncoders(); services.AddDataProtection(); return services; } public static IServiceCollection AddAuthentication(this IServiceCollection services, Action configureOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configureOptions == null) { throw new ArgumentNullException(nameof(configureOptions)); } services.Configure(configureOptions); return services.AddAuthentication(); } } }