shaj13 / go-guardian

Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.
MIT License
543 stars 55 forks source link

jwt Example doens't return a token #99

Closed shachardevops closed 3 years ago

shachardevops commented 3 years ago

What version of Go are you using (go version)?

1.13

Does this issue reproduce with the latest release?

yes

What version of Go-Guardian are you using?

latest

What did you do?

https://play.golang.org/p/NlbR34g1GRM I just ran the jwt example

What did you expect to see?

I expect to get a token in the response

What did you see instead?

token:  
➜  ~ curl  -k http://127.0.0.1:8080/v1/book/1449311601 -u admin:admin
Author: Ryan Boyd 
➜  ~ curl  -k http://127.0.0.1:8080/v1/auth/token -u admin:admin
token:  
➜  ~ 

Token is empty

shachardevops commented 3 years ago

Solved - you need to update the example .
replace Method: gojwt.SigningMethodHS256, with Algorithm: jwt.HS256,

shachardevops commented 3 years ago

You did a really good job here! Awesome project.

shaj13 commented 3 years ago

@shachardevops thx, I would love to see a PR.