node.js - How do I submit and process request params with an Oauth request? -


i using meanjs stack develop web application. issue i'm having, regular signup process has unique parameters not common oauth user profile. so, when have user go signup facebook, move them new signup form, has them fill in parameters, , click "signup facebook."

the routes same common meanjs routes found here: https://github.com/meanjs/mean/blob/master/app/routes/users.server.routes.js

specifically these lines:

app.route('/auth/facebook').get(passport.authenticate('facebook', {     scope: ['email'] }));  app.route('/auth/facebook/callback').get(users.oauthcallback('facebook')); 

what do, have parameters attached request object, when auth process reaches exports.saveoauthuserprofile inside of: https://github.com/meanjs/mean/blob/master/app/controllers/users/users.authentication.server.controller.js function able access parameters , save them part of user model.

i have tried attaching parameters request , accessing

req.params.paramid

but not work, because cannot register param loaded request facebook api (or @ least seems way).

and have read elsewhere on stackoverflow can load request state, seems odd me. here's link that: facebook oauth: custom callback_uri parameters

so, guidance on how load data oauth request, when save user profile can access , save it, great.

thanks guys.

it's not clear me want achieve. "extra" fields, , why don't derive fields user's profile directly?. 98% of fb login implementations i've seen use "login facebook" button , user's data during oauth process itself, , not manually entered user.

with passport-facebook example, it's possible

a) configure custom scopes

b) enrich profile object custom scope's data

the profile object contain additional requested fields automatically, , don't need tweak request object itself.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -