Grant
Express
npm install grant-expressServer
const express = require('express')
const session = require('express-session')
const grant = require('grant-express')
const app = express()
// REQUIRED: any session store - see /examples/express-session-stores
app.use(session({secret: 'hi'}))
// mount grant
app.use(grant({
"defaults": {
"protocol": "http",
"host": "localhost:3000",
"transport": "session", //querystring | session
"state": true
},
"google": {
"key": "...",
"secret": "...",
"scope": ["openid", "profile", "email"],
"nonce": true,
"custom_params": {"access_type": "offline"},
"callback": "/hello"
}
}))Last updated