googlesamples / google-services

A collection of quickstart samples demonstrating the Google APIs for Android and iOS
https://developers.google.com
Apache License 2.0
3.05k stars 2.52k forks source link

Google Sign In - Mac Catalyst support (iPad apps to Mac) #420

Open filippozanfini opened 4 years ago

filippozanfini commented 4 years ago

Will Google Sign In be supported on iPad apps running on Mac?

appfrilans commented 4 years ago

I'm interested in this one as well

terrillt commented 4 years ago

This is also a critical need for our project.

LucaIaconelli commented 4 years ago

Any news?

chethanashastry commented 4 years ago

This is required for our app. Is this in pipeline? Any news?

appfrilans commented 4 years ago

Is there any alternatives in the meantime?

yilei commented 4 years ago

Ping?

girishw commented 4 years ago

+1 This is critical for me.

itayAmza commented 4 years ago

Updates?

girishw commented 4 years ago

Any updates?

ptsochantaris commented 4 years ago

It would be great if there was some update to this issue along with a sense of some timeframe.

Catalyst support is especially important for internal tools that use Google Auth on our end. At the very least perhaps some suggestions on alternative workarounds for the issue?

sayantan300 commented 4 years ago

Who are you?

On Thu, Apr 16, 2020, 2:41 PM Paul Tsochantaris notifications@github.com wrote:

It would be great if there was some update to this issue along with a sense of some timeframe.

Catalyst support is especially important for internal tools that use Google Auth on our end. At the very least perhaps some suggestions on alternative workarounds for the issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/googlesamples/google-services/issues/420#issuecomment-614520514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO2U3MTHKY4VZLJHNYJXZ5DRM3DU7ANCNFSM4IXAV5XQ .

trannguyenvu91 commented 4 years ago

Any updates?

ptsochantaris commented 4 years ago

Any updates? (he also asked, expecting full well the answer to be crickets)

Does anybody else have thoughts or experience on possible workarounds for this problem? Any info would be greatly appreciated.

ondrejhanak commented 4 years ago

I was able to make Google Sign In work with this: https://github.com/elsesiy/GAppAuth.

ptsochantaris commented 4 years ago

@ondrejhanak Indeed, GAppAuth worked great, many thanks for the pointer. Amazing that the official SDK remains broken to this day.

natecraft1 commented 4 years ago

@ondrejhanak @ptsochantaris Would you mind posting a gist? Having trouble with this

ptsochantaris commented 4 years ago

@natecraft1 I personally just followed the iOS instructions on the README in that repo, and things worked great, except one issue where the server needed me to add some extra auth contexts via GAppAuth.shared.appendAuthorizationRealm, in our case it needed:

        GAppAuth.shared.appendAuthorizationRealm("email")
        GAppAuth.shared.appendAuthorizationRealm("profile")

in order to get the same id token that the app used to send to the server when it used the Google SDK. I assume the official SDK probably adds them by default? Apart from that, it "just worked". I hope this is of some help!

girishw commented 4 years ago

@ondrejhanak @ptsochantaris Would you mind posting a gist? Having trouble with this

What is the issue you are running into?

natecraft1 commented 4 years ago

Chrome just redirects to google.com and the GAppAuth.shared.authorize() callback never gets called. If I change the default browser to Safari it says macOS doesn't recognize the internet address after trying to sign in with google.

ApostolisApo commented 4 years ago

@natecraft1 I personally just followed the iOS instructions on the README in that repo, and things worked great, except one issue where the server needed me to add some extra auth contexts via GAppAuth.shared.appendAuthorizationRealm, in our case it needed:

        GAppAuth.shared.appendAuthorizationRealm("email")
        GAppAuth.shared.appendAuthorizationRealm("profile")

in order to get the same id token that the app used to send to the server when it used the Google SDK. I assume the official SDK probably adds them by default? Apart from that, it "just worked". I hope this is of some help!

after the authorize succeeds how do we sign in to Firebase? Can I use this? Auth.auth().signIn(withCustomToken: idToken)

EDIT: turns out I had to call - (void)signInWithCredential:(FIRAuthCredential *)credential instead and build the credential with

(FIRAuthCredential *)credentialWithIDToken:(NSString *)IDToken
                                 accessToken:(NSString *)accessToken;

from GoogleAuthProvider

natecraft1 commented 3 years ago

In my ViewController:

class ViewController: NSViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        do {
            try GAppAuth.shared.authorize { (success) in
                // never called
            }
        } catch {
            print(error)
        }
    }

What happens is that it pops Safari, and when I sign in with my email, it just lands me on google.com and the callback is not called. Could it be an issue with the redirect URI? Also, why it doesn't use the default browser? Is that configurable?

Thanks @ptsochantaris @girishw @ApostolisApo 🙌

masaldana2 commented 3 years ago

I NEED THIS

narek-sv commented 3 years ago

Any updates, Google? What an unresponsive team!

appfrilans commented 3 years ago

I am also waiting for this!

kenoButler commented 3 years ago

It would be great if one of the Google devs could provide some sort of update or ETA on this.