Issues with oAuth2

Environment

  • Container running on Google Cloud Run
  • MongoDB Storage (node-red-mongo-storage-plugin)
  • AdminAuth with passport-google-oauth20

I have two issues and I believe that they're related.

** Issue 1 **
When I login with passport everything is fine but randomly it seems the session expires. For instance I can click on "Deploy" and sometimes an error saying not authorized to deploy.

** Issue 2 **
I'm using node-red-contrib-google-calendar for calendar integration with relies on oAuth2. However, it seems like when my first issue happens my Google Calendar nodes are no longer able to access the credentials. I have to delete the credentials and then readd them to be able to access the calendar again.

Here is my adminAuth config:

adminAuth: {
	type: "strategy",
	strategy: {
	  name: "google",
	  label: 'Sign in with Google',
	  icon: "fa-google",
	  strategy: require('passport-google-oauth20').Strategy,
	  options: {
		response_type: "code",
		project_id: "REDACTED",
		prompt: "consent",
		auth_uri: "https://accounts.google.com/o/oauth2/auth",
		token_uri: "https://www.googleapis.com/oauth2/v3/token",
		auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
		clientID: 'REDACTED',
		clientSecret: 'REDACTED',
		scope: 'email',
		callbackURL: "https://REDACTED.intelligentcx.io/admin/auth/strategy/callback",
		accessType: 'offline',
		token_uri: "https://www.googleapis.com/oauth2/v3/token",
		auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
		redirect_uris: "https://REDACTED.intelligentcx.io/admin/auth/strategy/callback", 
		javascript_origins: "https://REDACTED.intelligentcx.io",
		client_secret: "REDACTED",
	  },
		verify: function(token, tokenSecret, profile, done) {
			profile.username = profile.emails.find(x => x.verified).value;
			done(null, profile);
		 }
	},
	users: function (username) {
	  return Promise.resolve({
		username: username,
		permissions: "*"
	  });
	}
  },

Not quite sure what's goin on here.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.