subzerocloud / postgrest-starter-kit

Starter Kit and tooling for authoring REST API backends with PostgREST
MIT License
744 stars 71 forks source link

JWSError JWSInvalidSignature #15

Closed jjohnson1994 closed 7 years ago

jjohnson1994 commented 7 years ago

I'm using the JWT token from the example on this page: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.vAN3uJSleb2Yj8RVPRsb1UBkokqmKlfl6lJ2bg3JfFg

When I make a request this error message is returned (curl & Postman):

{
    "message": "JWSError JWSInvalidSignature"
}

I've also copied the example JWT token into the .env file replacing the string "reallyreallyreallysecret".

....
# Global configs
DEVELOPMENT=1
JWT_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.vAN3uJSleb2Yj8RVPRsb1UBkokqmKlfl6lJ2bg3JfFg

# DB connection details (used by all containers)
DB_HOST=db
....

Have I missing something here?

ruslantalpa commented 7 years ago

No you are not, i recently replaced the secret in the repo but did not update the the wiki token

Basically the key used to generate the token in the wiki is "secret" but the key in the repo is "really..."

I'll correct that soon

Try generating a token on jwt.io yourself since you know the secret needed to generate the token

On 17 Sep 2017, at 10:30, jjohnson1994 notifications@github.com wrote:

I'm using the JWT token from the example on this page: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.vAN3uJSleb2Yj8RVPRsb1UBkokqmKlfl6lJ2bg3JfFg

When I make a request this error message is returned (curl & Postman):

{ "message": "JWSError JWSInvalidSignature" } I've also copied the example JWT token into the .env file replacing the string "reallyreallyreallysecret".

....

Global configs

DEVELOPMENT=1 JWT_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.vAN3uJSleb2Yj8RVPRsb1UBkokqmKlfl6lJ2bg3JfFg

DB connection details (used by all containers)

DB_HOST=db .... Have I missing something here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

ruslantalpa commented 7 years ago

I updated the wiki page with this JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.uSsS2cukBlM6QXe4Y0H90fsdkJSGcle9b7p_kMV1Ymk