You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MyApp/_pages/releases/v8_05.md
+106-9Lines changed: 106 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -492,10 +492,14 @@ We're excited to migrate our templates to Kamal for deployments as it has distil
492
492
493
493
## Simple API Keys Credentials Auth Provider
494
494
495
-
We've improved the usability of [Simple Auth with API Keys](/auth/admin-apikeys) story with the new
496
-
`ApiKeyCredentialsProvider`which enables .NET Microservices provide user session like behavior using
497
-
simple API Keys which you'd configure together with the `AuthSecretAuthProvider` and `ApiKeysFeature` to enable
498
-
a Credentials Auth implementation which users can use with their API Keys or Admin AuthSecret.
495
+
The usability of the [Simple Auth with API Keys](/auth/admin-apikeys) story has
496
+
been significantly improved with the new `ApiKeyCredentialsProvider` which enables .NET Microservices to provide
497
+
persistent UserSession-like behavior using simple API Keys which can be configured together with the
498
+
`AuthSecretAuthProvider`and `ApiKeysFeature` to enable a Credentials Auth implementation which users can
499
+
use with their API Keys or Admin AuthSecret.
500
+
501
+
A typical configuration for .NET Microservices looking to enable Simple Auth access whose APIs are protected
502
+
by API Keys and their Admin functionality protected by an Admin Auth Secret can be configured with:
499
503
500
504
```csharp
501
505
public class ConfigureAuth : IHostingStartup
@@ -505,7 +509,7 @@ public class ConfigureAuth : IHostingStartup
505
509
{
506
510
services.AddPlugin(new AuthFeature([
507
511
new ApiKeyCredentialsProvider(),
508
-
new AuthSecretAuthProvider(AppConfig.Instance.AuthSecret),
512
+
new AuthSecretAuthProvider("MyAuthSecret"),
509
513
]));
510
514
services.AddPlugin(new SessionFeature());
511
515
services.AddPlugin(new ApiKeysFeature());
@@ -518,12 +522,105 @@ public class ConfigureAuth : IHostingStartup
518
522
}
519
523
```
520
524
521
-
When registered a Credentials Auth dialog will appear for [ServiceStack Built-in UIs](https://servicestack.net/auto-ui) allowing users to Sign In with their API Keys or Admin Auth Secret.
525
+
When registered a Credentials Auth dialog will appear for [ServiceStack Built-in UIs](https://servicestack.net/auto-ui)
526
+
allowing users to Sign In with their **API Keys** or Admin **Auth Secret**.
Behind the scenes this creates a Server [Auth Session](/auth/sessions)
533
+
but instead of maintaining an Authenticated User Session it saves the API Key in the session then attaches the API Key to each request. This makes it possible to make API Key validated requests with just a session cookie instead of requiring resubmission of API Keys for each request.
534
+
535
+
### Secure .NET Microservices and Docker Appliances
536
+
537
+
This is an ideal Auth Configuration for .NET Docker Appliances and Microservices like [AI Server](/posts/ai-server) that don't need the complexity of ASP .NET Core's Identity Auth machinery and just want to restrict access to their APIs with API Keys and restrict Admin functionality to Administrator's with an Auth Secret.
538
+
539
+
The benefit of `ApiKeyCredentialsProvider` is that it maintains a persistent Session so that end users
540
+
only need to enter their API Key a single time and they'll be able to navigate to all of AI Server's protected pages using their API Key maintained in their Server User Session without needing to re-enter it for each UI and every request.
541
+
542
+
### User Access with API Keys
543
+
544
+
AI Server uses **API Keys** to restrict Access to their AI Features to **authorized Users** with Valid API Keys who
545
+
are able to use its Built-in UIs for its AI Features with the Users preferred Name and issued API Key:
Behind the scenes this creates a server session like normal [Session Auth](/auth/sessions) but instead of maintaining an Authenticated User Session it saves the API Key in the session then attaches the API Key to each request which is how it's able to make API Key validated requests with just a session cookie instead of resubmitting their API Key
0 commit comments