Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curityio/dotnet-api-jwt-validation
Code example of how to validate JWTs and authorize requests in a .NET API
https://github.com/curityio/dotnet-api-jwt-validation
api claims code-example dotnet jwt-validation oauth2 scopes zero-trust
Last synced: about 2 months ago
JSON representation
Code example of how to validate JWTs and authorize requests in a .NET API
- Host: GitHub
- URL: https://github.com/curityio/dotnet-api-jwt-validation
- Owner: curityio
- License: apache-2.0
- Created: 2021-03-04T08:25:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T08:42:07.000Z (about 2 months ago)
- Last Synced: 2024-11-29T09:34:51.927Z (about 2 months ago)
- Topics: api, claims, code-example, dotnet, jwt-validation, oauth2, scopes, zero-trust
- Language: C#
- Homepage: https://curity.io/resources/learn/dotnet-api/
- Size: 12.7 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Validate JWTs in .NET
=============================================.. image:: https://img.shields.io/badge/quality-experiment-red
:target: https://curity.io/resources/code-examples/status/.. image:: https://img.shields.io/badge/availability-source-blue
:target: https://curity.io/resources/code-examples/status/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 runContributing
~~~~~~~~~~~~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.