Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uber authorization with privileged scopes not working #235

Open
IrakliZ opened this issue Apr 3, 2016 · 6 comments
Open

Uber authorization with privileged scopes not working #235

IrakliZ opened this issue Apr 3, 2016 · 6 comments

Comments

@IrakliZ
Copy link

IrakliZ commented Apr 3, 2016

According to the Uber documentation, when authorizing, the response_type must be code, but looking at line 30 on oauth.uber.js the response type is token. This seems to be working for every general scope (different scopes can be found here), but when authorizing for the privileged ones such as request, Uber responds with the following: "ERROR REQUESTED SCOPE NOT VALID FOR IMPLICIT GRANT".

@nraboy
Copy link
Owner

nraboy commented Apr 4, 2016

I'm wondering if Uber dropped support for implicit grants, although it is normal for implicit grants to receive less permissions than explicit.

This is a tough call. Technically, explicit grants should never be used in a client facing application. This is because the keys are so easily obtainable from a decompile app. I know ng-cordova-oauth violates this rule quite a bit, but as I always say, use at your own risk.

So the question is, do we leave the implicit grant because it is (or may be) available, or do we switch to the explicit version. I'm leaning more on the implicit.

@matheusrocha89 @IrakliZ any opinions?

@matheusrocha89
Copy link
Contributor

I'm leaning more on the implicit version too. The Hybrid apps are not secure yet to save keys, if you get the apk and just unzip it you will get all the code and keys without hard work.

@IrakliZ
Copy link
Author

IrakliZ commented Apr 4, 2016

I think you're right, keeping the implicit grant is a good idea, but it could be changed so that the user could request the authorization code as well instead of just the token. I didn't think about it until now but it's a bit weird how Uber used to allow implicit grants for scopes such as request, which allows developers to make ride requests on behalf of the users.

@nraboy
Copy link
Owner

nraboy commented Apr 5, 2016

When working with implicit grants you cannot get the code. That makes it an explicit grant. It is an either or kind of deal, not both.

Maybe open a ticket with Uber and ask why their auth API changed?

@IrakliZ
Copy link
Author

IrakliZ commented Apr 5, 2016

I'm not very experienced with this so please feel free to correct me. What I was trying to suggest in my previous comment was that you could allow users to get the access_token with implicit grant for privileged scopes (which is currently the case), or let them request the authorization_code (which you can do by changing the response_type to be code) which they'll use to get the access_token themselves. Thinking about it now, it seems like a bit of a hack because you'd be doing both implicit grant and the first step of the code grant in the same place.

@nraboy
Copy link
Owner

nraboy commented Apr 5, 2016

I see what you're saying now.

It seems a bit hacky. Instead of throwing this ticket out, I'm going to leave it open for a while and see if anyone else adds to it. This is a very unique situation that I've not run into yet with this library.

If you know anyone else using Uber APIs, please point them here so they can add their two-cents.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants