Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jandev/service-to-service-authorization
Sample used to show how services can interact with each other using AAD access tokens.
https://github.com/jandev/service-to-service-authorization
Last synced: 17 days ago
JSON representation
Sample used to show how services can interact with each other using AAD access tokens.
- Host: GitHub
- URL: https://github.com/jandev/service-to-service-authorization
- Owner: Jandev
- License: mit
- Created: 2023-09-15T13:46:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-12T06:53:29.000Z (6 months ago)
- Last Synced: 2024-06-12T12:11:35.709Z (6 months ago)
- Language: Jupyter Notebook
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# Sample project for authorization & authentication between services
This sample contains two services, both ASP.NET WebAPI projects.
Both are set up to use Azure Active Directory (AAD) authentication & authorization, using role-based security.
The `Sample.Manufacturing.Dotnet.Api` is the backend application.
The `Sample.Partner.Dotnet.Api` is a frontend API from which authenticated requests will be made from within the service.## Set up
The `appsettings.json` files need to be populated with identifiers that can be retrieved from AAD.
The process on how to get these details can be found in the Microsoft docs on the matter, or consult me so I can explain.The `ServiceController.cs` file also needs a couple of identifiers, similar to the ones set in the configuration. Again, the process on how to get these details can be found in the Microsoft docs on the matter, or consult me so I can explain.
## Sample usage
Run both applications.
Invoke a GET-request to `https://localhost:7100/api/Service` (from the `Sample.Partner.Dotnet.Api` project) (assuming the hostname & port aren't changed), and see the results appear from the `WeatherController` (in the Sample.`Manufacturing.Dotnet.Api`` project).
If a 401 or 403 error is returned, or some other error, there is probably a configuration error.