Created
November 24, 2012 02:49
-
-
Save fruchtose/4138167 to your computer and use it in GitHub Desktop.
Everyauth OAuth 2 submodule sequences
This file contains hidden or 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
var weibo = module.exports = | |
oauthModule.submodule('weibo') | |
// ... | |
.get('entryPath', | |
'the link a user follows, whereupon you redirect them to the 3rd party OAuth provider dialog - e.g., "/auth/facebook"') | |
// ... | |
.get('callbackPath', | |
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/facebook/callback"') | |
// ... | |
.step('fetchOAuthUser') | |
.accepts('accessToken') | |
.promises('oauthUser') | |
// ... | |
.stepseq('authCallbackErrorSteps') | |
.step('handleAuthCallbackError', | |
'a request handler that intercepts a failed authorization message sent from the OAuth2 provider to your service. e.g., the request handler for "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request."') | |
.accepts('req res next') | |
.promises(null) | |
// End of oauth2 sequence definitions | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment