passport-dropbox-oauth2
passport-dropbox-oauth2 copied to clipboard
OAuth fails when using Dropbox Business API key
Fail to fetch user profile error occurs at https://github.com/florianheinemann/passport-dropbox-oauth2/blob/master/lib/passport-dropbox-oauth2/strategy.js#L120-L121.
The error occurs because the Dropbox Business API key does not have the permission to get an individual user's profile.
A potential fix would be to fetch the team member profiles, and select the profile with the role of team_admin. See https://www.dropbox.com/developers/documentation/http/teams#team-members-list.