Code Monkey home page Code Monkey logo

fb_passport_mysql's Introduction

Facebook + Passport + MySQL server

This repo is a skeleton framework for a JavaScript application that uses Passport and MySQL. It already has a Facebook authentication strategy built-in. You'll need to have MySQL installed and running.

To get started with this repo, first run npm install to grab the necessary dependencies. Next, put your database name, login, password, and url in the server.js file inside the mysql.createConnection function. Now, from the config directory of this repo, type mysql [db_name] < schema.sql where [db_name] is the name of your database.

Finally, to set up Facebook authentication, you will need to create a Facebook app from https://developers.facebook.com/. Make sure it is pointing to the correct domain for your application. Then, create a file called auth.js in the config folder and write the following code:

module.exports = {
  'facebookAuth' : {
    'clientID': 'APP_ID_HERE',
    'clientSecret': 'APP_SECRET_HERE',
    'callbackURL': 'http://YOUR.APP.LOCATION/auth/facebook/callback'
  }
}

Be sure to replace APP_ID_HERE, APP_SECRET_HERE, and YOUR.APP.LOCATION with the appropriate information.

Special thanks to Brent Aureli for his tutorials on getting Facebook authentication to work. This repo is a modified version of his Facebook authentication tutorial, using MySQL instead of MongoDB.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.