Socket
Book a DemoInstallSign in
Socket

bare-auth-google

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-auth-google

Stateless authentication with Google using Bare Auth

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

bare-auth-google

Google authentication with Bare Auth.

Installation

npm install bare-auth-google

Setup

1. Create an App

Go to: https://cloud.google.com/console/project to get started

2. Add a valid Redirect URI

Important: Don't forget to add the trailing slash as part of the valid redirect URI. Facebook will fail silently and you won't know why.

Setup the client-side

var Google = require('google-bare-auth');
var google = Google({
  url: 'http://auth.example.com'
  client_id: google_client_id,
  scope: ['profile']
})

google(function(err, profile) {
  if (err) throw err;
  console.log(profile);
});

Important: url points to the domain of your auth server (example server-side below). The routing will be set up for you

4. Setup the server-side (example uses Express)
var Google = require('google-bare-auth');
var bodyParser = require('body-parser');
var express = require('express');
var cors = require('cors');

var app = module.exports = express();

app.use(cors());
app.use(bodyParser.json());

app.use(Google({
  client_secret: client_secret
  // optionally include a 'sign' function to add support for JWT
}));

app.listen(5000);

License

MIT

Copyright (c) 2015 Matthew Mueller <matt@lapwinglabs.com>

Keywords

authentication

FAQs

Package last updated on 05 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.