Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upEnsure only 1 authentication method is used during /token access in o… #99
Conversation
lib/index.js
Outdated
@@ -38,6 +38,7 @@ internals.schema = Joi.object({ | |||
protocol: Joi.string().valid('oauth', 'oauth2'), | |||
temporary: Joi.string().when('protocol', { is: 'oauth', then: Joi.required(), otherwise: Joi.forbidden() }), | |||
auth: Joi.string().required(), | |||
authMethod: Joi.string().valid('basic', 'param').when('protocol', { is: 'oauth2', then: Joi.required(), otherwise: Joi.forbidden() }), |
This comment has been minimized.
This comment has been minimized.
hueniverse
Jun 9, 2015
Member
I would implement this as a boolean since there are only two ways to authenticate. I would make the default using the header because that's the proper way to do it and allow for a params override.
…nd auth in header. Add documentation
This comment has been minimized.
This comment has been minimized.
@hueniverse Updated as per your comments. Thank you! |
README.md
Outdated
@@ -71,6 +71,7 @@ The `server.auth.strategy()` method requires the following strategy options: | |||
- `'oauth'` - OAuth 1.0a | |||
- `'oauth2'` - OAuth 2.0 | |||
- `temporary` - the temporary credentials (request token) endpoint (OAuth 1.0a only). | |||
- `useParamsAuth` - boolean that determines if OAuth client id and client secret will be sent as parameters as opposed to an Authorization header (OAuth 2.0 only). Defaults to false. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks, done. |
geek
added a commit
that referenced
this pull request
Jun 10, 2015
Ensure only 1 authentication method is used during /token access in o…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
ldesplat commentedJun 5, 2015
…auth2
Added authMethod in provider options schema which is required when oauth2 is selected.
Now, when retrieving the token bell will either use body parameters or basic header auth but not both at the same time. See Issue #98 .
I have updated all the oauth2 providers as per their specs:
arcgisonline
dropbox
facebook
foursquare
github
google
instagram
linkedin
live
nest
phabricator
reddit
vk