-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this took me three days to get it here but worth it best practices from two of kevin dockx's pluralsight courses were utilized here to implement identityserver4: - Securing Microservices in ASP.NET Core - Securing ASP.NET Core 3 with OAuth2 and OpenID Connect now, all authentication and token issuing is done by the identity microservice and not the client since identityserver4 is meant to authenticate users only, i had to create a customer api with the microservice to deal with customers, making use of the customer service created earlier for this exact purpose i also got to utilize a skill i never thought i'd utilize and that is custom authorization requirements at the level of the microservices. the custom authorization requirements add security in the middleware instead of having that logic being in the method which is an added bonus and a very handy technique an issue i encountered was that the role wasn't mapped in the access token from identityserver4 so i created a custom x-user-role header that is sent with each relevant request with the administrator role which is checked for in the custom authorization requirements for the solution to work the way it always had tokens issued now will never expire because of a helper library identitymodel.aspnetcore which deals with token refresh and setting a valid bearer token with each request, resolving a shortcoming of the previous implementation
- Loading branch information
1 parent
2d1614a
commit 6d1255c
Showing
305 changed files
with
95,924 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../SeelansTyres.Mvc/Models/CustomerModel.cs → ...yres.Mvc/Models/External/CustomerModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace SeelansTyres.Mvc.Models; | ||
namespace SeelansTyres.Mvc.Models.External; | ||
|
||
public class CustomerModel | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace SeelansTyres.Mvc.Models; | ||
|
||
public class PasswordModel | ||
{ | ||
[Required] | ||
public string Password { get; set; } = string.Empty; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../SeelansTyres.Mvc/Models/RegisterModel.cs → ...yres.Mvc/Models/External/RegisterModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ansTyres.Mvc/Models/UpdateAccountModel.cs → ...Mvc/Models/External/UpdateAccountModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.