Simplicity icon indicating copy to clipboard operation
Simplicity copied to clipboard

Google login keeps asking for authorizations

Open jeromeboursier opened this issue 8 years ago • 1 comments

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

jeromeboursier avatar Nov 24 '16 17:11 jeromeboursier

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?

edjiang avatar Dec 05 '16 17:12 edjiang