-
Notifications
You must be signed in to change notification settings - Fork 14
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
Authentication Flow [Important Read] #5
Comments
Hey Raul, Thanks for opening up this issue! I've started working on (and thinking a lot more about) auth in the last two months, and I'm trying to really understand how OAuth 2 specifies several different types of
We're never going to use the password grant type, as providers won't trust us with their user's passwords as that's a huge phishing risk. Also, we'll never be using client credentials in our apps. That leaves the Authorization Code and Implicit grant types. The Authorization Code grant type is intended to be a server-side flow, as you need a client secret to use it. For instance, from the Instagram API docs: Since an app can be decompiled, or HTTP requests can be intercepted, an end user can find out the client secret, which is bad since it enables anyone to perform operations that are meant to only be used from a server. For instance, in the Instagram case, a malicious user could view and modify the app's subscriptions to user data. The implicit grant type gets rid of the token exchange and need for the client secret, but unfortunately is supported by fewer OAuth providers. I'm not sure it's a good idea to be encouraging people to put client secrets (or implement the authorization code flow in-app) in a production application, but I'm open to understanding how security is handled here. Otherwise, I definitely see the convenience to using the auth code flow for testing (for providers that don't support implicit), but warning people not to use it in production. TLDR: Auth code flow (implemented by AuthViewController) requires the client secret, which shouldn't be embedded in the app. |
Would using Implicit give the app full access to the user account? user based limit and not client based limit? If so, then I will definitely open a ticket to fix that. Looks like you are correct though, I will test it out to see if I get the same results. |
Implicit should give the app reasonable access to the account. Some actions are still only going to be server-side. The main problem is that some OAuth providers only support the authorization code flow, so won't be supported if you switch this to the implicit flow. But I would only recommend the authorization code flow for testing / development purposes, and never for production anyways. |
Ok, after reading all of this, there is nothing really forcing AuthenticationViewController to use the 3 steps or the 2 steps. If you want to do only the Client Flow with Instagram all you need to do is skip the call to But like you mentioned, very few providers support this 2 step flow instead of the full 3. |
Has brought up by @edjiang on https://twitter.com/EdwardStarcraft/status/712727368788353024 which authentication flow should we use for this library?
Would love some feedback
The text was updated successfully, but these errors were encountered: