You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am just wondering what the approach would be to pass additional/custom parameters through on authorize() such that they get passed into the AuthorizationCode arg of saveAuthorizationCode. The type is written in such way that it allows for pretty much any k/v to be added to that object, however in my attempts, only the fields explicitly defined in your authorize-handler get passed into that method. In my use case, my provider has a custom parameter called usid, which refers to a unique shopper id that we pass in on the authorize call, and then use it on the token call. It does some behind the scenes magic that I'm not privy too, but I know we need it.
I looked through the code and this is the culprit, as its hardcoding the only values that get passed into saveAuthorizationCode.
I figured I'd add my 2cents on how I'm currently doing it. I'm using the authenticateHandler handle method which accepts the Request object as a parameter that I can just tack on the usid to the object that the function returns.. then the user object gets passed into the saveAuthorizationCode method. I don't know if that's the right answer but it works for now.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am just wondering what the approach would be to pass additional/custom parameters through on authorize() such that they get passed into the AuthorizationCode arg of saveAuthorizationCode. The type is written in such way that it allows for pretty much any k/v to be added to that object, however in my attempts, only the fields explicitly defined in your authorize-handler get passed into that method. In my use case, my provider has a custom parameter called usid, which refers to a unique shopper id that we pass in on the authorize call, and then use it on the token call. It does some behind the scenes magic that I'm not privy too, but I know we need it.
I looked through the code and this is the culprit, as its hardcoding the only values that get passed into saveAuthorizationCode.
node-oauth2-server/lib/handlers/authorize-handler.js
Lines 103 to 112 in 8a2b7c0
I figured I'd add my 2cents on how I'm currently doing it. I'm using the authenticateHandler
handle
method which accepts the Request object as a parameter that I can just tack on the usid to the object that the function returns.. then the user object gets passed into the saveAuthorizationCode method. I don't know if that's the right answer but it works for now.Beta Was this translation helpful? Give feedback.
All reactions