06-11-2016 18:14 - edited 06-18-2016 10:45
06-11-2016 18:14 - edited 06-18-2016 10:45
Hi All,
I'm working on my first Fitbit API app and am using HelloJS to handle all of the OAuth calls.
I got my authorization process happening when I only request one scope. As soon as I ask for more than 1, I get the following error:
"invalid_scope - The requested scope is invalid, unknown, or malformed: profile,activity"
Here's my init() snippet:
hello.init({ 'fitbit': '227MZD' }, {redirect_uri: 'index.html', scope: 'profile, activity'})
I'm thinking it's the formatting of the scope field. I've tried the following:
scope: 'profile, activity'
scope: ['profile', 'activity']
scope: 'profile,activity'
scope: 'profile activity'
scope: 'profile+activity'
Any ideas?
06-18-2016 10:45
06-18-2016 10:45
Found my solution. HelloJS seems to replace spaces with commas, so "profile activity" becomes "profile,activity".
Solution: "profile%20activity"
06-20-2016 12:02
06-20-2016 12:02
Spaces are the official and only correct scope delimiter according to the OAuth 2.0 framework. This looks like a bug in HelloJS.