hapi-auth-jwt icon indicating copy to clipboard operation
hapi-auth-jwt copied to clipboard

getting bad http header format erro

Open gmchaturvedi1 opened this issue 8 years ago • 8 comments

{ "statusCode": 400, "error": "Bad Request", "message": "Bad HTTP authentication header format" }

kindly help me to resolve it i am new to hapi

gmchaturvedi1 avatar Mar 30 '16 02:03 gmchaturvedi1

Your Authorization header should be 'Bearer '

vmendiratta avatar Apr 26 '16 19:04 vmendiratta

@vmendiratta can we please give some example related to 'Bearer' token ? I also facing the same error,

uditkumawat avatar Jun 16 '16 06:06 uditkumawat

Your request should have an Authorization header field. The value of this field would look like: Bearer

Example: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1

vmendiratta avatar Jun 16 '16 06:06 vmendiratta

thanks :+1:

uditkumawat avatar Jun 16 '16 07:06 uditkumawat

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

genaro-picazo avatar Oct 07 '16 19:10 genaro-picazo

can u please give example to Authorization with model roles :admin, super admin and user

moshejutru avatar Jan 18 '17 09:01 moshejutru

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.

mpj avatar Feb 04 '17 15:02 mpj

Why Is it necessary to added this "Bearer" prefix to the token ???

ignivaravinderrikhi avatar Dec 05 '17 14:12 ignivaravinderrikhi