https://github.com/cenkozturrk/jwtokenauthdemo
"This project showcases the implementation of JWT token authentication in a .NET application, providing a secure and stateless way to manage user access."
https://github.com/cenkozturrk/jwtokenauthdemo
csharp jwt-authentication
Last synced: about 1 month ago
JSON representation
"This project showcases the implementation of JWT token authentication in a .NET application, providing a secure and stateless way to manage user access."
- Host: GitHub
- URL: https://github.com/cenkozturrk/jwtokenauthdemo
- Owner: cenkozturrk
- Created: 2022-01-05T10:58:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-29T23:06:36.000Z (over 1 year ago)
- Last Synced: 2025-12-20T00:18:53.420Z (7 months ago)
- Topics: csharp, jwt-authentication
- Language: C#
- Homepage:
- Size: 683 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JWT Token Authentication Demo
This project showcases the implementation of **JWT (JSON Web Token)** authentication in a .NET application, providing a secure and stateless way to manage user access and authorization.
## Features
- Demonstrates the generation and validation of JWT tokens.
- Includes user login and token issuance.
- Secures API endpoints using JWT-based authorization.
- Implements role-based access control for added security.
## Prerequisites
Before running this project, ensure you have the following installed:
- [.NET SDK](https://dotnet.microsoft.com/download) (version 6.0 or later)
- A tool to test API requests (e.g., [Postman](https://www.postman.com/) or cURL)
## How It Works
1. **User Login:**
- The user sends their credentials (username and password) to the authentication endpoint.
- A JWT token is generated upon successful login and returned to the user.
2. **Securing Endpoints:**
- API endpoints are protected with JWT authorization.
- The token must be included in the `Authorization` header (`Bearer `) of each request.
3. **Token Validation:**
- The server validates the token's signature, expiration, and claims before granting access to protected resources.
## Getting Started
1. Clone this repository:
```bash
git clone https://github.com/yourusername/JWTokenAuthDemo.git
cd JWTokenAuthDemo