From 0c575fe0596e37282315cebd35f0d7574e68c0e7 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Wed, 13 Dec 2023 17:26:04 +0800 Subject: [PATCH] Update index.md --- MyApp/_pages/auth/index.md | 41 +------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/MyApp/_pages/auth/index.md b/MyApp/_pages/auth/index.md index b0bed4a929..c0a0a656d0 100644 --- a/MyApp/_pages/auth/index.md +++ b/MyApp/_pages/auth/index.md @@ -191,48 +191,9 @@ class MyService : MyServiceBase { } ``` -### In Process Authenticated Requests - -You can enable the `CredentialsAuthProvider` to allow **In Process** requests to Authenticate without a Password with: - -```csharp -new CredentialsAuthProvider { - SkipPasswordVerificationForInProcessRequests = true, -} -``` - -When enabled this lets **In Process** Service Requests to login as a specified user without needing to provide their password. - -For example this could be used to create an [Intranet Restricted](/auth/restricting-services) **Admin-Only** Service that lets you login as another user so you can debug their account without knowing their password with: - -```csharp -[RequiredRole("Admin")] -[Restrict(InternalOnly=true)] -public class ImpersonateUser -{ - public string UserName { get; set; } -} - -public class MyAdminServices : Service -{ - public async Task Any(ImpersonateUser request) - { - using var service = base.ResolveService(); //In Process - return await service.PostAsync(new Authenticate { - provider = AuthenticateService.CredentialsProvider, - UserName = request.UserName, - }); - } -} -``` - -::: info -Your Services can use the new `Request.IsInProcessRequest()` to identify Services that were executed in-process -::: - ### Using a Global Request Filter -Otherwise you can use a [global Request Filter](/request-and-response-filters) if you wanted to restrict all requests any other way, e.g something like: +Otherwise you can use a [Global Request Filter](/request-and-response-filters) if you wanted to restrict all requests any other way, e.g something like: ```csharp GlobalRequestFiltersAsync.Add(async (req, res, requestDto) =>