Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No scheme? #32

Closed
spacesuitdiver opened this issue Oct 13, 2015 · 3 comments
Closed

No scheme? #32

spacesuitdiver opened this issue Oct 13, 2015 · 3 comments

Comments

@spacesuitdiver
Copy link

Is it possible to specify no scheme and have passport-jwt just match the contents of Authorization header and/or configure the header? It's not really possible to accurately use this plugin with Swagger's security credentials object with this requirement.

@mikenicholson
Copy link
Owner

From issue #20

I based the need to specify an auth-scheme based on RFC2617 "HTTP Authentication: Basic and Digest Access Authentication" section 1.2. This RFC specifies that the credentials supplied in the Authorization header take the format

credentials = auth-scheme #auth-param

Based on my reading of the RFC it does not appear that the auth-scheme can be considered optional.

For this implementation I'm going to stick with the RFC. I'm planning to overhaul how the JWT is parsed from the request in a 2.0.0 release in the near future. In the new version you will be able to provide a function which accepts a request and returns a JWT so client code has complete control with how the JWT is provided. Existing functionality will be baked into some commonly use retrieval functions that will be provided wit the strategy.

@mikenicholson
Copy link
Owner

The apiv2 branch is up. This branch uses a function to extract the JWT from the request allowing the user to pass the request any way they want If you want to try it out and provide feedback you can change the dependency in your package.json to match the following:

  "dependencies": {
    "passport-jwt": "git+https://github.com/themikenicholson/passport-jwt.git#apiv2"
  },

Looking forward to feedback and suggestions on the new api before I release it.

@mikenicholson
Copy link
Owner

The v2.0.0 release is complete. This should now be possible through custom extractor functions. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants