-
Notifications
You must be signed in to change notification settings - Fork 56
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
bearer token use in protected resources server #6
Comments
Hey @panva, good question. I like where you're going with this. Is the OAuth2Bearer usage specifically different from the regular Bearer? I think it would be nice to be able to maintain a single What if:
The only downside is that multiple tokens will look like For the more information case, what if:
|
Is there an RFC other than https://tools.ietf.org/html/rfc6750 that Bearer was modelled after?
The usual result of such a request would be |
Hey @panva, sorry for the delay there. Okay, so yeah I based it on the RFC 6750 idea of "bearer tokens", but I did it loosely, with the goal of making it useful for implementation by lots of the APIs that I see in the wild that use tokens, but not always exactly as OAuth designates them. For example:
Essentially, I like to think of the "basic" and "bearer" permits as more abstract goals, to make them flexible enough to model most common APIs, where they aren't specifically "to spec". The "basic" permit's goal is a username and password, whereas the "bearer" permit's goal is a single bearer token. This mean they can be used for anything that attempts to get at those two goals. For example, OAuth also uses the basic scheme for the client credentials grant, and it does so with the configuration: const clientCredentials = new Basic({
query: ['client_id', 'client_secret']
}) Which is fairly easy to configure, but the However, I agree with you that it should be tweaked to solve the issues you mentioned, since it should be possible to configure the const oauthBearer = new Bearer({
query: 'access_token',
body: 'access_token',
}) ...with the proper error handling. So it sounds like we'd need to:
|
Hello @ianstormtaylor,
coming from Bearer Token Usage environment there are a couple of things I couldn't find in your library. These might make sense to adopt so that the library is ready for use for Resource Servers.
application/x-www-form-urlencoded
body is missing at the moment. I understand this might be tricky to explain to users but most commonlyreq.body
is populated by popular body parsers in frameworks such as express, forkoa-body
an option needs to be passed ({ patchNode: true }
).What's your opinion on this and would you accept a PR filling it in? My proposal,
The text was updated successfully, but these errors were encountered: