feathersjs-ecosystem / authentication-oauth2

[MOVED] OAuth 2 plugin for feathers-authentication
https://github.com/feathersjs/feathers
MIT License
26 stars 15 forks source link

How to setup a dynamic URL parameters to successRedirect URL #48

Closed 0xori closed 6 years ago

0xori commented 6 years ago

How can I achieve this flow: I would like to pass custom URL parameters to the auth URL like - /auth/facebook?custom_param=123 and then add the custom URL parameters to the successRedirect URL so in case of success it will redirect to ?custom_param=123

I know that if you're using passport on express you can do something like this:

app.get('/auth/facebook/login/:id', function(req,res,next) {
  passport.authenticate(
    'facebook', 
     {callbackURL: '/auth/facebook/login_callback/'+req.params.id }
  )(req,res,next);
});

app.get('/auth/facebook/login_callback/:id', function(req,res,next) {
  passport.authenticate(
    'facebook',
     {
       callbackURL:"/auth/facebook/login_callback/"+req.params.id
     , successRedirect:"/login_ok.html"
     , failureRedirect:"/login_failed.html"
     }
   ) (req,res,next);
 });

where can I set it up if I'm using feathers?

daffl commented 6 years ago

Moved to https://github.com/feathersjs/feathers/issues/990