Skip to content

Instantly share code, notes, and snippets.

@MikyStar
Created August 7, 2018 08:38
Show Gist options
  • Save MikyStar/2d9a8878cdcdc99a37d67f79851c0a6f to your computer and use it in GitHub Desktop.
Save MikyStar/2d9a8878cdcdc99a37d67f79851c0a6f to your computer and use it in GitHub Desktop.

OAuth2 (Open Authorization 2)

Contents

Understanding the flow

  1. The user click on how he want to being logged in
  2. Our server handle the request
  3. Our server ask the provider for his permission to access user's account : If the user wants to be logged with his Google's account's informations, we will use Google as a provider for instance.
  4. Provider gives his answer through a route we have gave to him.
  5. Our server handle the previous response
  6. If it's ok we can store or use the data retrieved by the provider or even create a cookie.

Strategies

Strategies are third part modules that allow us to call the provider's server. For each provider you want (Google, GitHub ...) you will need to install a strategie.

Google

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment