https://github.com/fraidev/jwt-go
Simple RS256 JWT implementation with GO and Fiber
https://github.com/fraidev/jwt-go
fiber go golang jwt
Last synced: about 2 months ago
JSON representation
Simple RS256 JWT implementation with GO and Fiber
- Host: GitHub
- URL: https://github.com/fraidev/jwt-go
- Owner: fraidev
- License: mit
- Created: 2021-06-02T00:29:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-02T02:56:14.000Z (almost 4 years ago)
- Last Synced: 2025-02-12T14:28:56.178Z (3 months ago)
- Topics: fiber, go, golang, jwt
- Language: Go
- Homepage:
- Size: 4.64 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### RS256 Test
_Login using username and password to retrieve a token._
```
curl --data "user=john&pass=doe" http://localhost:3000/login
```
_Response_
```json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"
}
```_Request a restricted resource using the token in Authorization request header._
```
curl localhost:3000/restricted -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NjE5NTcxMzZ9.RB3arc4-OyzASAaUhC2W3ReWaXAt_z2Fd3BN4aWTgEY"
```
_Response_
```
Welcome John Doe
```