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

Query string #2

Closed
xogeny opened this issue Feb 24, 2015 · 6 comments
Closed

Query string #2

xogeny opened this issue Feb 24, 2015 · 6 comments

Comments

@xogeny
Copy link

xogeny commented Feb 24, 2015

Currently, only the Authorization header is checked. One could imagine that developers might want to configure this middleware to check the Authorization header and/or a query parameter (e.g., auth_code).

What do you think about making this configurable? I can submit the PR. I just want to know if you will accept such a PR.

@mgonto
Copy link
Contributor

mgonto commented Feb 24, 2015

Hey,

I thought of that but didn't have time yet to implement it!

I'm up to making it configurable. Maybe 3 configurations like in angular-jwt:

type: Header || Param. Defaults to Header
fieldName: Authorization
tokenType: Bearer

What do you think about it?

Thanks for offering to do a PR. We'll gladly accept it if you can do it.

Thanks again!

@jfromaniello
Copy link
Member

I think a func req -> token , like in express-jwt will be better.

@xogeny
Copy link
Author

xogeny commented Feb 24, 2015

@jfromaniello Could you elaborate? It seems like what you want is essentially just a middleware interface. But we already have that (at least if you are coming from negroni or martini). The question is really what to do "in the middle". The current implementation simply validates the identify of the person making the request. That is actually all I want. What I want to make configurable is where that identity is extracted from (Authorization header, query string, ...)

express-jwt actually seems to be enforcing policies as well. I don't really want to go that far (since I have my own policy enforcement layer already).

I'll put together a PR and you guys can comment on it. I'll post here when the PR is submitted (should be this morning).

@xogeny
Copy link
Author

xogeny commented Feb 24, 2015

@jfromaniello Ah! OK. Now I see your point. What you are saying is that the user could provide a function that extracts the token from the request. Got it! That's a good idea. I'll try and build on that.

This was referenced Feb 24, 2015
@mgonto
Copy link
Contributor

mgonto commented Feb 24, 2015

@jfromaniello good idea.

Thanks @mtiller for the PR ;)

@drawks
Copy link

drawks commented May 3, 2016

Seems like this issue can be closed since #3 was merged?

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

5 participants