alpody/golang-fiber-realworld-example-app

Invalid or Expired JWT

Closed this issue · 5 comments

Hi! I seem to be messing up something simple. When I use this project and I try to create an article I get an “Invalid or Expired JWT” response. Here is a screenshot from the Swagger UI:

image


curl -X 'POST' \
  'http://localhost:8585/api/articles' \
  -H 'accept: application/json' \
  -H 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODkzNjU0NzQsImlkIjoxfQ.YLT46ESWKl8B1_Ykm_rOJB1G0eT2luVruZTtoyAVyKQ' \
  -H 'Content-Type: application/json' \
  -d '{
  "article": {
    "body": "string",
    "description": "string",
    "tagList": [
      "string"
    ],
    "title": "string"
  }
}'
alpody commented

Hi! Can u run integration test in your system?

make newmanx

alpody commented

You must add "Token" word in Authorization header or in Swagger UI ApiKey "Token yourToken"

You must use such query.

curl -X 'POST' \
  'http://localhost:8585/api/articles' \
  -H 'accept: application/json' \
  -H 'Authorization: Token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODkzNjU0NzQsImlkIjoxfQ.YLT46ESWKl8B1_Ykm_rOJB1G0eT2luVruZTtoyAVyKQ' \
  -H 'Content-Type: application/json' \
  -d '{
  "article": {
    "body": "string",
    "description": "string",
    "tagList": [
      "string"
    ],
    "title": "string"
  }
}'

alpody commented

It's not a bug. Issue was closed.

Ahhh I see. Thanks. Sorry for being slow to respond. I appreciate your time.