From 28dbecf86de006aaa6d977139d888e38f9b13848 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:39:06 -1000 Subject: [PATCH] rm links to auth samples /2 (#32263) * rm links to auth samples * fix * fix * Update aspnetcore/toc.yml * fix * fix --- .openpublishing.redirection.json | 7 ++++- aspnetcore/grpc/authn-and-authz.md | 4 +-- aspnetcore/security/authentication/samples.md | 31 ------------------- aspnetcore/toc.yml | 2 -- 4 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 aspnetcore/security/authentication/samples.md diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index e2d844a764..1064d26673 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1,5 +1,10 @@ -{ +{ "redirections": [ + { + "source_path": "aspnetcore/security/authentication/samples.md", + "redirect_url": "/aspnet/core/security/authorization/introduction", + "redirect_document_id": false + }, { "source_path": "aspnetcore/fundamentals/aot/request-delegate-generator/rgd_ids.md", "redirect_url": "/aspnet/core/fundamentals/aot/request-delegate-generator/rdg_ids", diff --git a/aspnetcore/grpc/authn-and-authz.md b/aspnetcore/grpc/authn-and-authz.md index fb2941c69c..fb3451a0f8 100644 --- a/aspnetcore/grpc/authn-and-authz.md +++ b/aspnetcore/grpc/authn-and-authz.md @@ -32,7 +32,7 @@ app.MapGrpcService(); > [!NOTE] > The order in which you register the ASP.NET Core authentication middleware matters. Always call `UseAuthentication` and `UseAuthorization` after `UseRouting` and before `UseEndpoints`. -The authentication mechanism your app uses during a call needs to be configured. Authentication configuration is added in `Program.cs` and will be different depending upon the authentication mechanism your app uses. For examples of how to secure ASP.NET Core apps, see [Authentication samples](xref:security/authentication/samples). +The authentication mechanism your app uses during a call needs to be configured. Authentication configuration is added in `Program.cs` and will be different depending upon the authentication mechanism your app uses. Once authentication has been setup, the user can be accessed in a gRPC service methods via the `ServerCallContext`. @@ -301,7 +301,7 @@ public void Configure(IApplicationBuilder app) > [!NOTE] > The order in which you register the ASP.NET Core authentication middleware matters. Always call `UseAuthentication` and `UseAuthorization` after `UseRouting` and before `UseEndpoints`. -The authentication mechanism your app uses during a call needs to be configured. Authentication configuration is added in `Startup.ConfigureServices` and will be different depending upon the authentication mechanism your app uses. For examples of how to secure ASP.NET Core apps, see [Authentication samples](xref:security/authentication/samples). +The authentication mechanism your app uses during a call needs to be configured. Authentication configuration is added in `Startup.ConfigureServices` and will be different depending upon the authentication mechanism your app uses. Once authentication has been setup, the user can be accessed in a gRPC service methods via the `ServerCallContext`. diff --git a/aspnetcore/security/authentication/samples.md b/aspnetcore/security/authentication/samples.md deleted file mode 100644 index 56ae0d321c..0000000000 --- a/aspnetcore/security/authentication/samples.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Authentication samples for ASP.NET Core -author: rick-anderson -description: Provides links to the authentication samples in the ASP.NET Core repository. -ms.author: riande -ms.date: 02/21/2021 -uid: security/authentication/samples ---- -# Authentication samples for ASP.NET Core - -By [Rick Anderson](https://twitter.com/RickAndMSFT) - -The [ASP.NET Core repository](https://github.com/dotnet/aspnetcore) contains the following authentication samples (`main` branch): - -* [Claims transformation](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/ClaimsTransformation) -* [Cookie authentication](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/Cookies) -* [Custom authorization failure response](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/CustomAuthorizationFailureResponse) -* [Custom policy provider - IAuthorizationPolicyProvider](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/CustomPolicyProvider) -* [Dynamic authentication schemes and options](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/DynamicSchemes) -* [External claims](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/Identity.ExternalClaims) -* [Selecting between cookie and another authentication scheme based on the request](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/PathSchemeSelection) -* [Restricts access to static files](https://github.com/dotnet/aspnetcore/tree/main/src/Security/samples/StaticFilesAuth) - -## Obtain and run the samples - -The sample links provided in this article provide samples for the upcoming release of ASP.NET Core. To obtain a sample for the current release or a prior release, perform the following steps: - -* Select the release branch of the [ASP.NET Core repository](https://github.com/dotnet/aspnetcore). For example, the `release/5.0` branch contains the samples for the ASP.NET Core 5.0 release. -* Clone or download the ASP.NET Core repository. -* On your local system, verify installation of the [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core) version matching the clone of the ASP.NET Core repository. -* Navigate to a sample in `aspnetcore/src/Security/samples` folder and run the sample with the [`dotnet run` command](/dotnet/core/tools/dotnet-run). diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index e4e0d945d7..c44209a8fa 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -1529,8 +1529,6 @@ items: uid: security/authentication/jwt - name: Map, customize, and transform claims uid: security/authentication/claims - - name: Authentication samples - uid: security/authentication/samples - name: Community OSS authentication options uid: security/authentication/community - name: Identity management solutions