Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Passport Github authentication strategy using OAuth 2.0


Configuration Steps

1 - Create a Github application

You must register an app with Github in Developers Applications in Github's settings panel. Once an app is created, clientID and clientSecret that will be used in the strategy configuration in addition to a callback URL that is you define and matches a route in your application.


Image Added



After the application is created, the overview page views the credentials that should be used in configuring the passport strategy as below 


Image Added


The GitHub authentication strategy authenticates users using a GitHub account and OAuth 2.0 tokens.

The GitHub authentication strategy authenticates users using a GitHub account and OAuth 2.0 tokens.The GitHub authentication strategy authenticates users using a GitHub account and OAuth 2.0 tokens.















Image Added

3 - Strategy Configuration

The passport-github strategy authenticates users using a Github user account and OAuth 2.0 tokens. Client ID and Secret granted in the creation of an app should be added to the config file as options so the strategy will be created. The callback URL will be used to receive the access-token, refresh-token, and profile which is the Github authenticated user profile

...

The GitHub authentication strategy authenticates users using a GitHub account and OAuth 2.0 tokens.

...

.