https://github.com/pacna/api.jwt
A RESTful service that simplifies the generation and management of JSON Web Tokens (JWTs).
https://github.com/pacna/api.jwt
csharp dotnet
Last synced: over 1 year ago
JSON representation
A RESTful service that simplifies the generation and management of JSON Web Tokens (JWTs).
- Host: GitHub
- URL: https://github.com/pacna/api.jwt
- Owner: pacna
- License: mit
- Created: 2020-09-03T03:33:55.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T01:34:35.000Z (over 1 year ago)
- Last Synced: 2024-10-24T17:03:23.021Z (over 1 year ago)
- Topics: csharp, dotnet
- Language: C#
- Homepage:
- Size: 318 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Api JWT

Api JWT is a RESTful service that simplifies the generation and management of JSON Web Tokens (JWTs).
## Example
To create a JWT, send a POST request to the API with the keys and values as the payload:
```bash
$ curl --header "Content-Type: application/json" --request POST --data '{"claims": {"foo":"bar"}, "expireAt":"2024-01-03T05:53:25.537Z"}' http://localhost:5000/api/v1/jwt
```
You should receive a response that contains the JWT:
```json
eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJqdGkiOiJkMjAwY2E4NS05MDk1LTQyYWItOTE2OS1mYTZlY2Q2NTVhMDgiLCJleHAiOjE3MzU4ODM2MDUsImlzcyI6IkFwaS5KV1QifQ.CeZqhdjJFB8As0jn09UezuM8zpD0Z0d7Ye6S3RESUkg
```
## Prerequisites
Before running API JWT, make sure you have the following dependencies installed on your system:
- [.NET Core](https://dotnet.microsoft.com/en-us/download) (v8)
## How to Run Locally
Follow the commands below to start the service:
1. To run the service:
```bash
$ dotnet run --project=./src/Api.JWT
```
2. To run the service in watch mode:
```bash
$ dotnet watch run --project=./src/Api.JWT
```
## Running Tests
To run the test, use:
```bash
$ dotnet test
```
**note:** The API currently uses an in-memory data store and does not require a database.