strongloop / loopback-example-passport

LoopBack example for facebook login
Other
185 stars 134 forks source link

Passport Github Example #103

Closed michaelerobertsjr closed 6 years ago

michaelerobertsjr commented 6 years ago

This example is needed, most engineers are going to want Github over social logins.

I found that the way to get Github to work as a provider I had to provide the entire url for my app as the callbackURL. It would be great if this were better documented. It took a ton of guessing and errors to get it working. I'll open a pr with a better example if someone can't.

  "github": {
    "provider": "github",
    "module": "passport-github",
    "strategy": "OAuth2Strategy",
    "clientID": process.env.GITHUB_CLIENT_ID,
    "clientSecret": process.env.GITHUB_CLIENT_SECRET,
    "callbackURL": "https://my.app.com/auth/github/callback",
    "authPath": "/auth/github",
    "callbackPath": "/auth/github/callback",
    "successRedirect": "/auth/account",
    "failureRedirect": "/login",
    "scope": ["email", "profile"],
    "failureFlash": true
  }
dhmlau commented 6 years ago

@michaelerobertsjr , please feel free to submit a PR! Thanks.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.