@md03/passport-google
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Google strategy for Passport.js

Easy to use Google strategy. It's just Sign In With Google implementation (https://developers.google.com/identity/gsi/web/guides/verify-google-id-token).

Installation

# pnpm:
pnpm add @md03/passport-google
# npm:
npm install @md03/passport-google
# yarn:
yarn add @md03/passport-google

Options

  • clientId (required) - required for idToken verification.

  • csrfCheck (optional) - strategy will validate g_csrf_token. False by default.

  • passReqToCallback (optional) - strategy will pass Request object to callback.

  • tokenFromRequest (optional) - strategy will use provided function to extract id token from request.

// example:
function getIdToken(req: Request) {
  return req.query.idToken;
}

Important things

  1. Use HTTPS
  2. Never include your secrets directly in your code base - use environment variables instead.

Package Sidebar

Install

npm i @md03/passport-google

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

16.4 kB

Total Files

19

Last publish

Collaborators

  • mich4ld