Coder Social home page Coder Social logo

claercio / angularjs-jwt-oauth2-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sumeetdas/angularjs-jwt-oauth2-demo

0.0 2.0 0.0 1.96 MB

An app demonstrating signing-in via Facebook, using JWT for authentication and front-end login redirect using UI Router

License: MIT License

JavaScript 79.14% HTML 19.86% CSS 1.00%

angularjs-jwt-oauth2-demo's Introduction

AngularJS-JWT-OAuth2-Demo

An app to demonstrate authorization and authentication built on top of MEAN stack.

Demo: http://www.sumeetdas.me

Click on 'Contact' (which you can find it on Navbar) and you will see the login drop down menu. Click on any of the buttons to login in to the application via the chosen OAuth2 provider and you'll be redirected to Contact page.

Features of this app include:

  1. Authentication using JWT (JSON Web Tokens)
  2. Using popup windows for OAuth 2.0 authentication
  3. User can either login via OAuth 2.0 or can login after signing up for a new user account (if one does not exist already)
  4. Some views may require login. Such scenarios are handled in the front-end itself by redirecting the user to login view and after successful login, the user is redirected back to the original view.
  5. Front-end technologies include:
    1. Angular
    2. Angular Bootstrap
    3. Angular UI Router
    4. Angular JWT (for decoding JWT tokens received from the server and sending them in every request to the server)
    5. ngStorage (for storing the JWT tokens)
    6. Font Awesome for displaying various icons
  6. Back-end technologies include:
    1. Express
    2. Mongoose
    3. Passport
    4. Jade Templating Engine
    5. jsonwebtoken (jwt utility library)
    6. Various Passport strategies for different OAuth 2.0 providers

Important Note: Since passport strategy for Twitter OAuth 1.0 a requires session support, I have decided not to include Twitter login.

Installation

  1. Download the repository
  2. Install npm modules: npm install
  3. Install bower modules: bower install
  4. Install mongodb server (if you haven't already) and start it
  5. Update config/mongo.json file with prod and dev mongodb config
  6. Update config/passport.json file with prod and dev OAuth2 config data for different providers
  7. Update config/token.json file with your own custom secret (to be used in JWT sent after a user is successfully logged in)

TODOs

  1. Test cases
  2. Docs

angularjs-jwt-oauth2-demo's People

Contributors

sumeetdas avatar

Watchers

 avatar  avatar

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.