This repository contains example code on how to use JWTs for authorization in .NET APIs. This will be managed using the .NET Core Security Framework. This allows for easy annotation of an endpoint to specify authorization policies.
[HttpGet("developer")] [Authorize(Policy = "developer")] public IActionResult Developer() { ... }
This repository contains the result of the Securing .NET Core API with JWT article. That article contains more in-depth information about the source code.
Update the appsettings.json
according to the article.
Then run
dotnet restore dotnet run
Pull requests are welcome. To do so, just fork this repo, and submit a pull request.
The files and resources maintained in this repository are licensed under the Apache 2 license.
Please visit curity.io for more information about the Curity Identity Server.
Copyright (C) 2021 Curity AB.