Skip to content

curityio/dotnet-api-jwt-validation

Repository files navigation

Validate JWTs in .NET

https://img.shields.io/badge/quality-experiment-red https://img.shields.io/badge/availability-source-blue

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.

Run the example

Update the appsettings.json according to the article.

Then run

dotnet restore
dotnet run

Contributing

Pull requests are welcome. To do so, just fork this repo, and submit a pull request.

License

The files and resources maintained in this repository are licensed under the Apache 2 license.

More Information

Please visit curity.io for more information about the Curity Identity Server.

Copyright (C) 2021 Curity AB.