Skip to content

Tomoka64/jwt-go-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To run

$ make run

To login

$ curl localhost:8080/login

test user is set. userName "test" publicKey "public-keys/demo.ecdsa.pub.pem"

To generate token

$ curl localhost:8080/ecdsa-generate

this will generate test token for user "test".

jwt claims { "sub": "test", "exp": 1234567890, }

To Authorize ecdsa

$ curl -i localhost:8080/ecdsa-auth -H "Authorization: bearer jwt token generated by ecdsa secret key..."

To clean up

$ make stop

To generate your own pair of public key and secret key.

To generate ecdsa key pairs

$ ssh-keygen -t ecdsa -m PEM
$ ssh-keygen -f demo.ecdsa.pub -e -m pkcs8 > demo.ecdsa.pub.pkcs8

About

example of jwt server implementation in Golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published