Skip to content

An example passport auth node app with postgres database backend. For self learning and later reference.

Notifications You must be signed in to change notification settings

sanion/postgres-oauth-example

 
 

Repository files navigation

#Postgres Oauth example A demonstration of postgres oauth in node. Heavily follows this guide from scotch.io, except I use postgres in place of Mongo for the database, and Jade in place of EJS for the html views.

Server-side Setup

This app requires a basic postgres setup. It also requires a lot of private Oauth application setup from Facebook, Twitter, and Google involving developer access to their Oauth services. This involves filling in config.js.

  1. Git clone
  2. Make sure you have postgres set up with user postgres with password postgres. So create the user with that password. To use another user, change the knex connection config in the code.
  3. postgres user should have createdb priviledges. To do so: ALTER USER postgres createdb in psql.
  4. Run the psql_script.sql script into postgres. Try using psql -U postgres -a -f psql_script.sql.
  5. Rename sample_config.js to config.js.
  6. Fill in config.js file with appropriate dev API access tokens. scotch.io has some great guides on how to do this.

About

An example passport auth node app with postgres database backend. For self learning and later reference.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.7%
  • HTML 15.3%