gapi.auth2.getAuthInstance().isSignedIn.get() is always false when Chrome Browser has multiple accounts - google-calendar-api

I copied the example given in Google Calendar API Quickstart and replaced it with the appropriate info. Every time I refresh the page, I'm asked to authorize before api data is fetched.
I'm using Chrome and I currently have multiple accounts / users. I noticed if I open an Incognito Window and sign in with one set of credentials then when I refresh the page I'm not asked to authorize.
Note, once I authenticate I receive calendar information so I don't believe it's an issue with client_id, api_key, scope, etc.
Looking at the example code, I'm guessing the getAuthInstance() is getting confused because of multiple accounts / users. Does anyone have any idea? Thanks!

This was happening when running on localhost. This issue stopped happening after deploying the webpage to a hosted server.

Related

Google OAuth 2.0 not working for Google Workspace (G Suite) Accounts

I have created a project at Google Developer Console. And I have followed the steps to create an OAuth Consent screen to ask users for their consent to let me use their email address and Google Calendar for my App. App is still at Test Mode, and everything is working fine.
But for the users of Google Workspace (G Suite) (#domain.com) the consent screen is not working. It just ends up saying that Something went wrong and ... the request is malformed.... I am sure it isn't malformed, because it is just working fine for non-workspace (#gmail.com) users.
I got it working later by Manage Domain Wide Delegation by logging into the Google Workspace Admin account and manually setting up my Apps's service account Client ID and Scopes. The process allowed users of that #domain.com (non-admin) email to get my consent screen working.
But this is not practical. I can't ask every #domain.com email address user to contact their Google Workspace Admins and add my app to the domain wide delegation area manually.
There are apps and services out there which connected to my non-admin Google Workspace account without having my Admin do it for me.
So there must be some way to get my consent screen work on #domain.com email addresses hosted at Google Workspace without involving the Admin account or Domain wide delegation stuff.
How can I get it done? Please help, I can't find any solution online.
EDIT More banging head in the wall, but no similar issues found on the internet. So what I feel like is that I need to wait for my OAuth application to be approved for production for it to work for Google Workspace accounts. PLEASE HELP if you know there is some other issue and I can try to fix...
Thanks.
Looks like there was some temporary issue with Google. I emailed them, and the issue was fixed.

Firebase google auth won't let me choose the account to connect with

I have implemented Firebase Auth into my app to let my users connect with their Google accounts. So far so good, however once a user has chosen to connect with a specific account from the google account chooser popup, he won't be able to choose a different account the next time he logs in. The previously selected account will be automatically picked for the authentication.
I really don't find this behavior correct, so I am trying to fix it.
After some research I found that I can use setCustomParameters(prompt: "select_account") with the googleProvider, like so:
this.googleProvider = new firebase.auth.GoogleAuthProvider();
this.googleProvider.setCustomParameters({
prompt: "select_account",
});
More info here: https://developers.google.com/identity/protocols/oauth2/openid-connect#authenticationuriparameters
In my case, using the consent and select_account parameters don't seem to have any impact, the user does not get to choose which account to use.
Edit: It would seem that it works correctly with chrome, but not with firefox...
I have found the source of the issue, it is in fact not really an issue. The google account picker will only show up if you have other accounts registered onto the device/browser you are currently using. If you want to choose a different account that is not saved into your device/browser, you would first need to log into it via google.

Google Oauth client was deleted. can I restore a new one?

We running a wordpress website use google oauth for third-party social login. (via WP Social Login plugin.) Former engineer is leave, and we cannot have past google account credential.
We face a problem shows:
Error 401
Error: deleted_client
The OAuth client was deleted.
but we can only see old client id and secret from website admin panel.
I wanna to know,
if we set up a new google oauth application id/secret, will it make user crash from login website?
Or, is it possible for us to restore/retrieve former application ownership and make it live again?
This happened to me when I was working on an Add-On (maybe not completely related to this question but similar). I mistakenly deleted a Client ID that I thought we weren't using.
How I solved it:
Created a new project in Google Cloud
Associated the Apps Script project (Add-on) to this new Google Cloud project
Then I re-associated the App Script project with my previous Google Cloud project
The previous step will re-compile, create and associate the Client ID to the App Script project. It will contain all settings from the Client ID manually created and associated with your project in the code.
Maybe this will give some light to anyone having a similar problem.
Here use this link:
https://support.google.com/cloud/answer/6251787?hl=en
You have to reach google and they will help you out, this is the only solution you can do.
In my case, the simplest/only path (though certainly not ideal) ended up being to create a new Firebase project and start using that.
This of course can be problematic if you have a lot of data to move and/or a nontrivial data schema - say, with nested collections. For me, it was worth the effort to get unblocked from Sign-In suddenly failing to work.
... ah, OAuth fun
=======
If you are trying to make the new Client ID work .. though it's not a total solution, but after searching for a while, found this config option in Firebase console - where you enable Google Sign In.
So if you generate a new OAuth Client ID, update the ID & secret there.
After I did this, it went from a 401 error to a 400 mis_direct , which I think was step in the right direction.

Meteor: Signin with linkedin not recognizing existing users

In my meteor application I am using the packages accounts-linkedin and linkedin to allow my users to signin with linkedin. This has always been working fine for several month. However, since yesterday users who have signed in to my website via linkedin in the past are not recognized anymore. When they go to "login with linkedin" a new meteor user account is created for them instead of logging them into their existing account.
When I test my application: Signing up via linkedin und then logging out and in, everything is working fine. Apparently it is only not working for accounts that already existed a few days ago.
This is really strange. The accounts code of meteor is really complex. What could be the reason that a user is not recognized anymore but a new user account gets created for them?
Could it be that linkedin messed up tokens on their side? (the linkedin id and accessToken in my users object (services.linkedin) did not change over the last days)
This is a bug in pauli:accounts-linkedin. The pauli:linkedin package was using the wrong value for the user's LinkedIn ID. I have submitted a pull request which fixes that problem for new users, but a fix is still needed to migrate the IDs of existing users. I recommend subscribing to the bug to track progress.

Facebook Open Graph API explorer offline_access tokens cant be ticked

I've recently been working on a project which gets data from the Facebook open graph API. All works fine except after a few hours it stops working and my token is no longer valid. Did some research and under extended permissions I need to tick offline_access so that my tokens last longer. I ticked offline access but the token i'm given still only lasts 2 hours and if I go back to check my permissions again it is still unticked. Done this over and over again and cant tick offline_access in the open graph API explorer.
Is anybody else experiencing this problem ?
Thank you in advance
Offline Access isn't supported for new apps and will be removed from existing apps soon, see here https://developers.facebook.com/roadmap/offline-access-removal/ for the migration information

Resources