hapi-auth-jwt
hapi-auth-jwt copied to clipboard
getting bad http header format erro
{ "statusCode": 400, "error": "Bad Request", "message": "Bad HTTP authentication header format" }
kindly help me to resolve it i am new to hapi
Your Authorization header should be 'Bearer
@vmendiratta can we please give some example related to 'Bearer' token ? I also facing the same error,
Your request should have an Authorization header field.
The value of this field would look like:
Bearer
Example: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1
thanks :+1:
My Authorization header is Bearer and I still get the error:
GET /books HTTP/1.1 Host: localhost:3000 Authorization: Bearer mGQMVgiiVFJWAWs7 Cache-Control: no-cache Postman-Token: 704a91cd-62c8-6061-b20e-2e7309f42c69
can u please give example to Authorization with model roles :admin, super admin and user
For future travelers: I was getting this error because I had forgotten the audience property in the params when requesting the token. That successfully gave me a token but it failed with this error when I actually tried to use it.
Why Is it necessary to added this "Bearer" prefix to the token ???