Skip to Content
Building Scalable Apps with Redis and Node.js
book

Building Scalable Apps with Redis and Node.js

by Joshua Johanan
September 2014
Intermediate to advanced
316 pages
7h 6m
English
Packt Publishing
Content preview from Building Scalable Apps with Redis and Node.js

Adding Google authentication to our application

First, we need to add our Google-specific information to our config. Open config.js and add the following lines:

routes: {
    login: '/account/login',
    logout: '/account/logout',
    chat: '/chat',    facebookAuth: '/auth/facebook',
    facebookAuthCallback: '/auth/facebook/callback',
    googleAuth: '/auth/google',
    googleAuthCallback: '/auth/google/callback'
  },
//host and facebook
google: {
    clientID: 'YOUR_GOOGLE_ID',
    clientSecret: 'YOUR_GOOGLE_SECRET'
  }

We haven't added anything different. We just had to create the two Google authentication routes and add the ID and secret.

The package we will use is passport-google-oauth. This should be installed already at this point through npm install. Notice that this is not ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reactive Programming with Node.js

Reactive Programming with Node.js

Fernando Doglio
Node: Up and Running

Node: Up and Running

Tom Hughes-Croucher, Mike Wilson
Learn TypeScript 3 by Building Web Applications

Learn TypeScript 3 by Building Web Applications

Sebastien Dubois, Alexis Georges

Publisher Resources

ISBN: 9781783984480Supplemental Content