Does not work with hapi-auth-jwt2
See original GitHub issueIf I add to my working code the npm module hapi-auth-jwt2, then all calls to /connect/provider returns 401. How I added it: as plugin in hapi require(‘hapi-auth-jwt2’) with a configuration
server.auth.strategy('jwt', 'jwt', {
key: config.JWT.SERIAL,
validateFunc: jwt.validate,
verifyOptions: {
algorithms: [ config.JWT.ALGORITHM ],
ignoreExpiration: true
},
headerKey: config.JWT.HEADER
});
server.auth.default('jwt');
Then the routes for grant have the configuration for disable jwt:
config: {
auth: false
}
It returns the body
{"statusCode":401,"error":"Unauthorized","message":"Missing authentication"}
and the headers
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Token
content-type: application/json; charset=utf-8
cache-control: no-cache
vary: accept-encoding
content-encoding: gzip
Date: Wed, 26 Oct 2016 08:30:58 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Do you have an idea why this is happening and could it be resolved by me or you?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
hapi-auth-jwt2 - npm
Hapi.js Authentication Plugin/Scheme using JSON Web Tokens (JWT). Latest version: 10.2.0, last published: 2 years ago.
Read more >hapi-auth-jwt2 works is not working in hapi.js app?
This is my server.js file and I run node server.js . 'use strict'; const Hapi = ...
Read more >Simple example is not working · Issue #285 · dwyl/hapi-auth-jwt2
Hello,. I'm creating a simple example with hapi-auth-jwt2 and its not working, im getting this error whenever I send GET request through POSTMAN ......
Read more >15 - JWT Strategy Auth and securing routes | restful API
Your browser can't play this video. ... https://hapi.dev/module/basic/#install hapi - auth - jwt2 : https://github.com/dwyl/ hapi - auth - jwt2 ...
Read more >hapi-auth-jwt2 examples - CodeSandbox
Latest version10.2.0. LicenseISC ; Size71.204Kb. Packages Using it ; Issues Count370. Stars785.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Rub21 In your routes:
in your server: (something like that)
hey @TBoonX ,
how did you enable for specific routes?