Firebase Auth for GTM Session Fetcher with Google APIs Client Library for Objective-C for REST

290 views
Skip to first unread message

Madeline Folkerts

unread,
Apr 16, 2020, 7:02:19 PM4/16/20
to google-toolbox-for-mac
Hi, I am using Google APIs Client Library for Objective-C for REST, which uses GTM Session Fetcher for authentication.

I wanted to switch from Google Sign In to a Firebase Authentication method (Phone Number Auth or Email/password Auth) for access to a private Google API.

Is it possible to implement GTMFetcherAuthorizationProtocol using a Firebase ID Token as the access token? The API I am using can be authorized by a Firebase ID Token, but I'm getting this error:

Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Thanks in advance!

Thomas Van Lenten

unread,
Apr 17, 2020, 9:51:45 AM4/17/20
to google-toolbox-for-mac
You'll likely need to ask on a Firebase support site, I'm not sure exactly what they provide, one would hope they already have something that implements the protocol.

TVL

Madeline Folkerts

unread,
Apr 17, 2020, 8:15:18 PM4/17/20
to google-toolbox-for-mac
Ok thanks, I actually got it working. The error ended up being specific to the API I'm using. If anyone is curious, a combination of the code here and here should work using the user's Firebase ID Token as the access token.
Reply all
Reply to author
Forward
0 new messages