How to migrate tokens from one project to another in Google console - google-calendar-api

We are having one Google console project for all our apps using Google Calendar now but we need to migrate token to another new project as the API quota is getting exceeded frequently.
So my question is, how can OAuth tokens be migrated between two client IDs in the same Google console account?
For example, suppose an OAuth token is created with a web client Id "A" in a project "Test1". How can this be migrated to be used with a web client Id "B" in project "Test2"? Both Test1 and Test2 will be in same Google account.

Related

Will Google Identity Service migration impact the authorization URL?

As a developer using Google API, I received the email "Migrate to the new Google Identity Services library". Our application has both Web-based and client solutions. We use Google Sign-In JavaScript library in the Web-based solution, which needs to be migrated. Our client solution calls the GetAuthorizationUrl() method of OAuth2ProviderForApplications in Google API .NET library to get the authorization URL and launch a browser window with the URL.
Is the URL from the .NET library affected by this migration?
I compared the URLs in the windows launched by both Google Sign-In and GIS and those from the .NET library. There seemed to be some difference:
GIS:
https://accounts.google.com/o/oauth2/v2/auth/oauthchooseaccount?...
Google Sign-in Javascript:
https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?...
Google API .NET library:
https://accounts.google.com/o/oauth2/auth?...
#2 and #3 are currently used in our system. When upgraded from Google Sign-in (#2) to GIS (#1), the authorization URL has "v2".
Is the "non v2" version of the authorization URL endpoint (#3) still valid after migration? As we will keep getting this non-v2 URL from the .NET library, it is important to make sure it is still working to avoid our service interruption.

firebase firestore gives error for a project that's been added to firebase projects

I've added my project to firestore and I'm doing firestore google auth just fine.
My problem is firebase firestore.
It just doesn't work and I have no idea why.
I'm trying to do a simple add before doing the actual process for my app and it doesn't work.
here I implemented a simple function to add a user and then called it, doing it all in build function.
I get this in my console:
p.s.
"adding user" is printed on console.
p.s.
I do have the firebase_options.dart file.
These thing are you sure that the correct:
1.Using correct google_services.json file
2.Edit Fire store rules if you are not using authorization
You have to manually whitelist your existing Google OAuth 2.0 client IDs in the Firebase console before using it with the new Auth APIs.
In order to do so, follow these steps:
Go to the Credentials section in the Google API Console.
Select from the top right corner the project where you had previously configured Google Sign-In.
Go to the OAuth 2.0 client IDs section
If you are using Google Sign-In on Android or iOS applications:
Take note of the Client ID string corresponding to all the entries registered for your applications.
Input these Client IDs into your Firebase project’s configuration:
Go to the Firebase console at https://console.firebase.google.com
Open the Auth section
Under Sign-In methods, open the Google configuration, and add there all you client IDs, to the whitelist of client IDs from external projects.
If you are using Google Sign-In on a web application:
Click to open your web client ID and take note of both the client ID and secret.
Input this Client ID into your Firebase project’s configuration:
Go to the Firebase console at https://console.firebase.google.com
Open the Auth section
Under Sign-In methods, open the Google configuration, and add the values under the Web SDK configuration section.

Firebase app limit per project - getting to 1000

I have seen mentioned that there is actually a 1000 app hard limit to Firebase projects as it is the OAuth 2.0 Client IDs that have a limit of 30 and that these can be deleted if not needed.
I have removed the OAuth Client ID for my app from here https://console.developers.google.com/apis/credentials
My app is a hybrid app (Ionic) and uses firebase auth with email/password via the web app not native one so it appears to work fine.
I am assuming this means I am home free and can add up to 1000 apps if I manually delete the OAuth 2.0 Client ID each time?
I am looking at adding Google and Facebook sign-in on the hybrid mobile apps using a native implementation (just for the google/fb auth) soon would this be something that I would need the native app OAuth 2.0 Client IDs for? Is this just used for Google Auth?
If so I guess this would restrict me back to 30 apps but I could use the web Google Auth (although the UX is not as good).
I will also be using Firebase Cloud messaging if that is related at all.
I am not familiar with OAuth 2.0 Client IDs so any help is appreciated as I don't want to go down this route but find a problem later on once my product has gone to market.
Note: I have read the recommendations from Firebase that each tenant / customer / label should have its own project. This is not how I want to implement my platform as the data is shared between tenants as users can belong to multiple tenants. Plus making a project per tenant seems crazy if I have up to 1000 tenants.
Some of the tenants but not all will have their own branded app. Same app with different branding and in different app store accounts.
https://firebase.google.com/docs/projects/learn-more#multi-tenancy
It appears the limit for apps has now been reduced to 30.
https://firebase.google.com/support/faq/#apps-per-project
If you need more than 30, the above FAQ entry states:
In the rare case your project requires more than 30 apps, you can request an app limit increase. Your project must be on the Blaze billing plan to make this request. Visit the Google Cloud Console to make your request and have it evaluated.

How does a firebase project need to be configured to get Google login working from an Expo Snack?

I'm trying to get Google Login working with Firebase from an Expo snack. I can login with Google and get the idToken and accessToken, but when I try to signInWithCredential to Firebase, I get a message that "the Google id_token is not allowed to be used with this application.". I feel like I'm missing some Firebase configuration step that I couldn't find in any of the Expo Firebase tutorials.
What step might be missing in my Firebase configuration or this Expo snack? https://snack.expo.io/HJWiiNRtW
Older post, but for posterity sake:
Your setup on the Expo snack looks fine. The problem you are having is a result of a mismatch between the client ID in the google developer console and firebase google Web SDK settings.
From google developer console, in your app, this will be the Client ID for Web application
603386649315-vp4revvrcgrcjme51ebuhbkbspl048l9.apps.googleusercontent.com
there will also be a client secret in there too.
In the firebase console for your app, in the authentication section, under google, click on Web SDK Configuration
and put the above noted project number (Web client ID) and client secret, and put these in their respective spots.
You will see that the project # being referenced in the error "873097287154..." will already be in the Web Client ID text box which is what you will replace with the client ID from google as noted above.

Can I use Service Account with Google Analytics?

Since few day I am trying to get user profile with my C# using Using OAuth 2.0 for Server to Server Applications with JWT.
For google drive i know that we can use server to server method, but i am not sure for Google Analytics. Can we use it ?
Yes you can!
Service Accounts
Useful for automated/offline/scheduled access to Google Analytics data for your own account. For example, to build a live dashboard of your own Google Analytics data and share it with other users.
There are a few steps you need to follow to configure service accounts to work with Google Analytics:
1. Register a project in the APIs Console.
2. In the Google APIs Console, under the API Access pane, create a client ID with the Application Type set to Service Account.
3. Sign-in to Google Analytics and navigate to the Admin section.
4. Select the account for which you want the application to have access to.
5. Add the email address, from the Client ID created in the APIs Console from step #2, as a user of the selected Google Analytics account.
6. Follow the instructions for Service Accounts to access Google Analytics data.
Source: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAuthorization
Not yet. See Service Accounts have arrived.
Service accounts are currently supported by the following Google developer services:
Google Cloud Storage
Google Prediction API
Google URL Shortener
Google OAuth 2.0 Authorization Server
Google APIs Console
Google APIs Client Libraries for Python, Java, and PHP
Over time, more Google APIs and client libraries will be supported.
Sign up for Google Developers Blog and the Analytics Blog feeds. They will post when GA is opened to service accounts, if it ever is.

Resources