问题
I know that the OAuth 2.0 specs allows to specify multiple scopes while requesting or issuing a token, but Uber doesn't like the multiple scopes.
For example:
1) [No error]
parameters = {
'response_type': 'code',
'redirect_uri': 'INSERT_ROUTE_TO_STEP_TWO',
'scope': 'profile',
}
Returns correct token and I can retrieve the user profile via 'https://api.uber.com/v1/me'
2) [Error]
parameters = {
'response_type': 'code',
'redirect_uri': 'INSERT_ROUTE_TO_STEP_TWO',
'scope': 'profile%20history',
}
Uber returns "Invalid Request Parameters". I tried 'scope': 'profile%20history' and 'scope': 'profile history'. Both cases returns the same error.
I'm an Android developer using https://github.com/twotoasters/AndrOAuth as a test.
Thanks
回答1:
Scope uses space delimiters.
You should pass scope as 'scope': 'profile history' and let the underlying http library handle the URI conversion rather than doing it explicitly by yourself.
回答2:
I'm sure you figured this out by now, but you are using a space to delimit your scope arguments and the api calls for a comma.
来源:https://stackoverflow.com/questions/25457242/uber-api-specify-multiple-scopes-while-requesting-or-issuing-a-token-returns-in