Authorization and Authentication #1181
-
I've been exploring .NET Aspire, focusing on its authorization and authentication aspects within the microservice architecture in the past few days. My background is in monolithic applications, so I'm adapting my knowledge to this new environment. To implement authorization and authentication, I've modeled my codebase on the eShopLite sample, creating three projects in my solution:
In both AuthService and AuthService.DbManager, I've configured services as follows:
On AuthService.Db just the DbContext as per usual for Identity:
So my main question(s) are:
Sorry for the long post but I'm quite new to the microservice architecture and .NET Aspire is being my door into this world. Any feedback is appreciated and if you read this far, you're a legend. Thanks in advance to all! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Bump |
Beta Was this translation helpful? Give feedback.
-
There’s nothing aspire provides for auth out of the box to make it easier and it’s out of scope for the initial release. There’s an issue for supporting a keycloak resource in the box but it unlikely to happen as nobody is driving it actively. It would be worth learn about
This is really an ASP.NET Core question, there’s no aspire involved here. You need to call these if you’re going to configure auth. it might be worthwhile to do this eshop workshop based on aspire that we just taught. The 3rd module has an entire section on auth and setting up keycloak . https://github.com/dotnet-presentations/eshop-app-workshop/tree/main/labs/3-Add-Identity |
Beta Was this translation helpful? Give feedback.
-
Is there a way to add authentication or authorization to the aspire dashboard? |
Beta Was this translation helpful? Give feedback.
#3033 started this, and there's ongoing work in this area so keep an eye out over the next while. The dashboard's README.md explains the options available. Note that the details will change a little in the next weeks as we add more options and sanitize the options for consistency, but it should be enough to get started.