Google OAuth2 issues

I'm trying to setup Google OAuth and well, just can't seem to get it to work - I get:

Error: invalid_request

Invalid parameter value for redirect_uri: Missing authority: Localhost:1880/auth/strategy/callback

My section looks like

  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: "MyProjectID",
                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",
         
                redirect_uris: "http://localhost:1880/auth/strategy/callback",
                javascript_origins: "http://localhost:1880",
                
                client_secret: "TheClientSecret",
                callbackURL: "Localhost:1880/auth/strategy/callback",
                clientID: "ClientIDProvidedByGoogle.apps.googleusercontent.com",
                scope: "https://www.googleapis.com/auth/userinfo.email",
                
                
            },
            verify: function(token, tokenSecret, profile, done) {
                return client_secret, clientID, token, tokenSecret, tokenuri
                done(null, profile);
            }
        },
        users: [{
            username: "MyEmail@work",
            permissions: "*"
        }]
    },

and the google OAuth - is Public
ApplcationName = NodeRedTest
Scope for APIs = email, Profile, openid
Authorized Domains MyWorkDomain (could THIS be the issue?)

I can't claim to have tried this particular auth strategy, but at a glance your verify function doesn't look right to me - it has a bad return statement which shouldn't be there:

verify: function(token, tokenSecret, profile, done) {
   return client_secret, clientID, token, tokenSecret, tokenuri
   done(null, profile);
}

By the way, when you share code on the forum, please format it by adding three back-ticks (```) one a new line before and after your code block. That makes it much easier to read and prevents any special characters (eg <, >) from being treated as html.

The Verify is from the Twitter example. BTW, works there, and with Github, just can't get it with Google

Where does the twitter example have a return statement in the middle of the verify function?

You are right, I missed that my co-worker added it
Removed that return - but I still get the same error

I'm not sure where co-worker got the Google URLs, so I'm looking that up too

Is there an example oAuth2 with google around that I can look at, as I can't find one!

Have you tried googling “ Oauth2 Google nodejs”?

Yes, but I must not understand how to take the examples, and change them to what we need in the Settings.js file. See lots of examples that show code, and heck, I can do it in .NET, and have done so (Hey, I'm normally a .NET guy who has gotten sucked into 'Secure our Node-red site, oh, and use OAuth2 from Google"

I'm just at the "Am I doing something wrong in the Settings.js, or in the API config side on Google, or both"

OK - I must be REALLY doing something wrong - decided to go back to the basics - went into Postman, and decided to try and post to:

Localhost:1880/auth/strategy/callback

(with no token and with the token in the body as JSON)
and either way I'm getting

Cannot POST /auth/strategy/callback

Any clues?

Did you get this working? - love to see it!