SimplicityMobile / Simplicity

A simple way to implement Facebook and Google login in your iOS apps.
Apache License 2.0
681 stars 66 forks source link

Google login keeps asking for authorizations #33

Open jeromeboursier opened 7 years ago

jeromeboursier commented 7 years ago

Hi everyone,

I was wondering why this strange behavior happen in my project : every time I try to re-connect to an account I already logged into, the Google Explorer (whom already know my password) keep asking me authorizations, even if it's my 3rd login to the same account. If I take a look at the Google documentation, it shouldn't be asking me permission over time :

Before making the first authenticated call, the Explorer asks you to choose which scope you would like to use when granting it access to your data.

Here's the code responsible for the login, but I guess this behavior doesn't come from him :)

let google = Google()
google.scopes = ["email"]
google.login { [unowned self] (accessToken, error) in
    if let token = accessToken {
        print("Call Google API with token : \(token)")
    }
}

So I was wondering if you guys know about that, and if a workaround exists :)

Thank you! Jérôme

edjiang commented 7 years ago

Hey Jerome,

I haven't responded to this yet because I don't quite remember the intricacies of the Google API, and haven't looked into it recently. However, from my knowledge about the Google APIs (at least from a mobile perspective), I thought Google's policy was to always show the authorization screen. Is it different with the Google SDK for iOS -- do you get the auth screen there too on subsequent logins?