Created
October 7, 2012 21:51
-
-
Save superfeedr/3849734 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ideal OAuth 2 (may be insane, impractical), also, lots of default behavior, all customizable, of course by some mechanism of your choice | |
app.get('/my-protected-resource', passport.authenticate('mechanism'), function(req, res, end) { | |
// Do stuff that requires to be logged in | |
}); | |
// Now the middleware does all the hard work: redirect to the oauth provider of choice (or to a 'dummy' page where the user can choice theirs and then to it, handle the dance, add all the required information to the session, and finally redirect the user to /my-protected-resource when the user was eventually logged in! How does that sound? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment