You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #11 a default scope of users.read was introduced.
However, when creating a minimum viable server for this strategy I noticed two issues with this implicit behavior:
Scope users.read is insufficient for accessing user's profile, the endpoint requires both users.read and tweet.read (probably to access the pinned tweet, regardless whether it is requested or not)
Probably more significant, the default scope isn't picked up during authenticate call. Debugging the issue, I found that the underlying OAuth2 Strategy reads the default scope from _scope if not passed in during the authenticate call:
In #11 a default scope of
users.read
was introduced.However, when creating a minimum viable server for this strategy I noticed two issues with this implicit behavior:
users.read
is insufficient for accessing user's profile, the endpoint requires bothusers.read
andtweet.read
(probably to access the pinned tweet, regardless whether it is requested or not)authenticate
call. Debugging the issue, I found that the underlying OAuth2 Strategy reads the default scope from_scope
if not passed in during the authenticate call:https://github.com/jaredhanson/passport-oauth2/blob/5fcd4c5238a3785794c8c8d0b4a1ab94f1f67bc1/lib/strategy.js#L231
In retrospect, I think this functionality couldn't work. Which is weird, because the test seem to asses this functionality.
Here is the code I am using:
When running this and visiting
http://localhost:3000/auth/twitter
, I get redirected to Twitter without thescope
URL parameter.The text was updated successfully, but these errors were encountered: