From aeb506c0b0f5107707b1ec43df08215657e2ee32 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 28 Jan 2019 21:37:51 -0800 Subject: [PATCH] Remove obsolete 1.x UseIdentity + UseXyz auth API (#6965) * Remove obsolete API * Delete CookieAppBuilderExtensions.cs * Delete FacebookAppBuilderExtensions.cs * Delete GoogleAppBuilderExtensions.cs * Delete JwtBearerAppBuilderExtensions.cs * Delete MicrosoftAccountAppBuilderExtensions.cs * Delete OAuthAppBuilderExtensions.cs * Delete OpenIdConnectAppBuilderExtensions.cs * Delete TwitterAppBuilderExtensions.cs --- src/Identity/Core/src/BuilderExtensions.cs | 31 ---------------- .../Cookies/src/CookieAppBuilderExtensions.cs | 37 ------------------- .../src/FacebookAppBuilderExtensions.cs | 37 ------------------- .../Google/src/GoogleAppBuilderExtensions.cs | 37 ------------------- .../src/JwtBearerAppBuilderExtensions.cs | 37 ------------------- .../MicrosoftAccountAppBuilderExtensions.cs | 37 ------------------- .../OAuth/src/OAuthAppBuilderExtensions.cs | 37 ------------------- .../src/OpenIdConnectAppBuilderExtensions.cs | 37 ------------------- .../src/TwitterAppBuilderExtensions.cs | 37 ------------------- 9 files changed, 327 deletions(-) delete mode 100644 src/Identity/Core/src/BuilderExtensions.cs delete mode 100644 src/Security/Authentication/Cookies/src/CookieAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/Facebook/src/FacebookAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/Google/src/GoogleAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/JwtBearer/src/JwtBearerAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/MicrosoftAccount/src/MicrosoftAccountAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/OAuth/src/OAuthAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/OpenIdConnect/src/OpenIdConnectAppBuilderExtensions.cs delete mode 100644 src/Security/Authentication/Twitter/src/TwitterAppBuilderExtensions.cs diff --git a/src/Identity/Core/src/BuilderExtensions.cs b/src/Identity/Core/src/BuilderExtensions.cs deleted file mode 100644 index e1f9defb43..0000000000 --- a/src/Identity/Core/src/BuilderExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Identity extensions for . - /// - public static class BuilderExtensions - { - /// - /// - /// This method is obsolete and will be removed in a future version. - /// The recommended alternative is - /// - /// - /// Enables ASP.NET identity for the current application. - /// - /// - /// The instance this method extends. - /// The instance this method extends. - [Obsolete( - "This method is obsolete and will be removed in a future version. " + - "The recommended alternative is UseAuthentication(). " + - "See https://go.microsoft.com/fwlink/?linkid=845470")] - public static IApplicationBuilder UseIdentity(this IApplicationBuilder app) - => app.UseAuthentication(); - } -} diff --git a/src/Security/Authentication/Cookies/src/CookieAppBuilderExtensions.cs b/src/Security/Authentication/Cookies/src/CookieAppBuilderExtensions.cs deleted file mode 100644 index bdfd43c796..0000000000 --- a/src/Security/Authentication/Cookies/src/CookieAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.Cookies; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add cookie authentication capabilities to an HTTP application pipeline. - /// - public static class CookieAppBuilderExtensions - { - /// - /// UseCookieAuthentication is obsolete. Configure Cookie authentication with AddAuthentication().AddCookie in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseCookieAuthentication is obsolete. Configure Cookie authentication with AddAuthentication().AddCookie in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseCookieAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseCookieAuthentication is obsolete. Configure Cookie authentication with AddAuthentication().AddCookie in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseCookieAuthentication is obsolete. Configure Cookie authentication with AddAuthentication().AddCookie in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseCookieAuthentication(this IApplicationBuilder app, CookieAuthenticationOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/Facebook/src/FacebookAppBuilderExtensions.cs b/src/Security/Authentication/Facebook/src/FacebookAppBuilderExtensions.cs deleted file mode 100644 index a94dc7bc45..0000000000 --- a/src/Security/Authentication/Facebook/src/FacebookAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.Facebook; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add Facebook authentication capabilities to an HTTP application pipeline. - /// - public static class FacebookAppBuilderExtensions - { - /// - /// UseFacebookAuthentication is obsolete. Configure Facebook authentication with AddAuthentication().AddFacebook in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseFacebookAuthentication is obsolete. Configure Facebook authentication with AddAuthentication().AddFacebook in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseFacebookAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseFacebookAuthentication is obsolete. Configure Facebook authentication with AddAuthentication().AddFacebook in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseFacebookAuthentication is obsolete. Configure Facebook authentication with AddAuthentication().AddFacebook in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseFacebookAuthentication(this IApplicationBuilder app, FacebookOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/Google/src/GoogleAppBuilderExtensions.cs b/src/Security/Authentication/Google/src/GoogleAppBuilderExtensions.cs deleted file mode 100644 index 4302d20db1..0000000000 --- a/src/Security/Authentication/Google/src/GoogleAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.Google; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add Google authentication capabilities to an HTTP application pipeline. - /// - public static class GoogleAppBuilderExtensions - { - /// - /// UseGoogleAuthentication is obsolete. Configure Google authentication with AddAuthentication().AddGoogle in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseGoogleAuthentication is obsolete. Configure Google authentication with AddAuthentication().AddGoogle in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseGoogleAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseGoogleAuthentication is obsolete. Configure Google authentication with AddAuthentication().AddGoogle in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseGoogleAuthentication is obsolete. Configure Google authentication with AddAuthentication().AddGoogle in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseGoogleAuthentication(this IApplicationBuilder app, GoogleOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} diff --git a/src/Security/Authentication/JwtBearer/src/JwtBearerAppBuilderExtensions.cs b/src/Security/Authentication/JwtBearer/src/JwtBearerAppBuilderExtensions.cs deleted file mode 100644 index 0cfc97573c..0000000000 --- a/src/Security/Authentication/JwtBearer/src/JwtBearerAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.JwtBearer; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add OpenIdConnect Bearer authentication capabilities to an HTTP application pipeline. - /// - public static class JwtBearerAppBuilderExtensions - { - /// - /// UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseJwtBearerAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseJwtBearerAuthentication is obsolete. Configure JwtBearer authentication with AddAuthentication().AddJwtBearer in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseJwtBearerAuthentication(this IApplicationBuilder app, JwtBearerOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/MicrosoftAccount/src/MicrosoftAccountAppBuilderExtensions.cs b/src/Security/Authentication/MicrosoftAccount/src/MicrosoftAccountAppBuilderExtensions.cs deleted file mode 100644 index 7fd71d7a9b..0000000000 --- a/src/Security/Authentication/MicrosoftAccount/src/MicrosoftAccountAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.MicrosoftAccount; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add Microsoft Account authentication capabilities to an HTTP application pipeline. - /// - public static class MicrosoftAccountAppBuilderExtensions - { - /// - /// UseMicrosoftAccountAuthentication is obsolete. Configure MicrosoftAccount authentication with AddAuthentication().AddMicrosoftAccount in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseMicrosoftAccountAuthentication is obsolete. Configure MicrosoftAccount authentication with AddAuthentication().AddMicrosoftAccount in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseMicrosoftAccountAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseMicrosoftAccountAuthentication is obsolete. Configure MicrosoftAccount authentication with AddAuthentication().AddMicrosoftAccount in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseMicrosoftAccountAuthentication is obsolete. Configure MicrosoftAccount authentication with AddAuthentication().AddMicrosoftAccount in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseMicrosoftAccountAuthentication(this IApplicationBuilder app, MicrosoftAccountOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/OAuth/src/OAuthAppBuilderExtensions.cs b/src/Security/Authentication/OAuth/src/OAuthAppBuilderExtensions.cs deleted file mode 100644 index d55f311f7b..0000000000 --- a/src/Security/Authentication/OAuth/src/OAuthAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.OAuth; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add OAuth 2.0 authentication capabilities to an HTTP application pipeline. - /// - public static class OAuthAppBuilderExtensions - { - /// - /// UseOAuthAuthentication is obsolete. Configure OAuth authentication with AddAuthentication().AddOAuth in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseOAuthAuthentication is obsolete. Configure OAuth authentication with AddAuthentication().AddOAuth in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseOAuthAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseOAuthAuthentication is obsolete. Configure OAuth authentication with AddAuthentication().AddOAuth in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseOAuthAuthentication is obsolete. Configure OAuth authentication with AddAuthentication().AddOAuth in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseOAuthAuthentication(this IApplicationBuilder app, OAuthOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectAppBuilderExtensions.cs b/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectAppBuilderExtensions.cs deleted file mode 100644 index 0746ae3fdb..0000000000 --- a/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.OpenIdConnect; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add OpenID Connect authentication capabilities to an HTTP application pipeline. - /// - public static class OpenIdConnectAppBuilderExtensions - { - /// - /// UseOpenIdConnectAuthentication is obsolete. Configure OpenIdConnect authentication with AddAuthentication().AddOpenIdConnect in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseOpenIdConnectAuthentication is obsolete. Configure OpenIdConnect authentication with AddAuthentication().AddOpenIdConnect in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseOpenIdConnectAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseOpenIdConnectAuthentication is obsolete. Configure OpenIdConnect authentication with AddAuthentication().AddOpenIdConnect in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A that specifies options for the handler. - /// A reference to this instance after the operation has completed. - [Obsolete("UseOpenIdConnectAuthentication is obsolete. Configure OpenIdConnect authentication with AddAuthentication().AddOpenIdConnect in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseOpenIdConnectAuthentication(this IApplicationBuilder app, OpenIdConnectOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file diff --git a/src/Security/Authentication/Twitter/src/TwitterAppBuilderExtensions.cs b/src/Security/Authentication/Twitter/src/TwitterAppBuilderExtensions.cs deleted file mode 100644 index 36e1111da6..0000000000 --- a/src/Security/Authentication/Twitter/src/TwitterAppBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.AspNetCore.Authentication.Twitter; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Extension methods to add Twitter authentication capabilities to an HTTP application pipeline. - /// - public static class TwitterAppBuilderExtensions - { - /// - /// UseTwitterAuthentication is obsolete. Configure Twitter authentication with AddAuthentication().AddTwitter in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// A reference to this instance after the operation has completed. - [Obsolete("UseTwitterAuthentication is obsolete. Configure Twitter authentication with AddAuthentication().AddTwitter in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseTwitterAuthentication(this IApplicationBuilder app) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - - /// - /// UseTwitterAuthentication is obsolete. Configure Twitter authentication with AddAuthentication().AddTwitter in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details. - /// - /// The to add the handler to. - /// An action delegate to configure the provided . - /// A reference to this instance after the operation has completed. - [Obsolete("UseTwitterAuthentication is obsolete. Configure Twitter authentication with AddAuthentication().AddTwitter in ConfigureServices. See https://go.microsoft.com/fwlink/?linkid=845470 for more details.", error: true)] - public static IApplicationBuilder UseTwitterAuthentication(this IApplicationBuilder app, TwitterOptions options) - { - throw new NotSupportedException("This method is no longer supported, see https://go.microsoft.com/fwlink/?linkid=845470"); - } - } -} \ No newline at end of file