【发布时间】:2012-12-08 10:43:59
【问题描述】:
我想在everyauth openid module 中定义的 OpenId 身份验证序列中再添加一个步骤。
我不确定everyauth 是否是为此而设计的。作者mentions说它是可定制的,但没有例子,我还是一个javascript新手。
例如,everyauth 中的 OAuth 模块定义其身份验证回调步骤如下:
.get('callbackPath',
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/facebook/callback"')
.step('getCode')
.description('retrieves a verifier code from the url query')
.accepts('req res')
.promises('code')
.canBreakTo('authCallbackErrorSteps')
.step('getAccessToken')
.accepts('code')
.promises('accessToken extra')
.step('fetchOAuthUser')
.accepts('accessToken')
.promises('oauthUser')
.step('getSession')
.accepts('req')
.promises('session')
.step('findOrCreateUser')
.accepts('session accessToken extra oauthUser')
.promises('user')
.step('compile')
.accepts('accessToken extra oauthUser user')
.promises('auth')
.step('addToSession')
.accepts('session auth')
.promises(null)
.step('sendResponse')
.accepts('res')
.promises(null)
如果我需要额外的自定义步骤,我应该怎么做?我宁愿不更改everyauth 模块源代码。
【问题讨论】:
标签: javascript node.js everyauth