Google OAuth2 issues

I managed to get something that seems to be working.

adminAuth: {
    type:"strategy",
    strategy: {
        name: "google",
        label: 'Sign in with Google',
        icon:"fa-google",
        strategy: require("passport-google-oauth20").Strategy,
        options: {
            clientID: "myId",
            clientSecret: "mySecret",
            scope: "email",
            callbackURL: "http://my-node-url.com/auth/strategy/callback",
            verify: function(token, tokenSecret, profile, done) {
                profile.username = profile.emails.constructor === Array ? profile.emails[0].value : null;
                return done(null, profile);
            }
        },
    },
    users: [
       { username: "my_email@gmail.com",permissions: ["*"]},
       { username: "some_other_user@gmail.com",permissions: ["read"]}
   ]
},
1 Like