javascript - Passport.js append custom parameter to authorizationURL-call -


is there way append custom parameters passport.js oauth2 call?

the call made url build follows:

authorizationurl?response_type=code&redirect_uri=callbackurl&scope=scope&client_id=clientid

is there way alter url , append "&myparameter=myvalue"

so wished result authorizationurl?response_type=code&redirect_uri=callbackurl&scope=scope&client_id=clientid&myparameter=myvalue

(all bold parameters specified below:)


long story:

defining strategy (e.g. amazon strategy) follows:

passport.use(new amazonstrategy({             clientid: config.amazon.clientid,             clientsecret: config.amazon.clientsecret,             callbackurl: config.amazon.callbackurl,             passreqtocallback: true,             authorizationurl: 'https://eu.account.amazon.com/ap/oa?',             tokenurl: 'https://api.sandbox.amazon.de/auth/o2/token'         } 

and request

app.get('/oauth/amazon', passport.authenticate('amazon', {         failureredirect: '/login',         scope: ['profile postal_code']     })); 

the callback similar request!

actual question:

how append "&myparameter=myvalue"


Comments