0

I'm using the oauth.io node sdk for server side authentication and I want to authorise multiple providers on my app, I'm just wondering if there is a way of doing it without having to create a separate endpoint for each one.

Something like this is what I'm after but the authorisation function doesn't seem to work when wrapped in a container function.

app.get('/signin', function(req, res){
  OAuth.auth(req.param.provider, 'http://localhost:8080/oauth/redirect')
});
user1803975
  • 345
  • 1
  • 4
  • 14

1 Answers1

0

Found answer thanks to thyb in this post

https://github.com/oauth-io/sdk-node/issues/14

app.get('/signin/:provider', function(req, res) {
  OAuth.auth(req.param.provider, 'http://localhost:8080/oauth/redirect')(req, res);
});
user1803975
  • 345
  • 1
  • 4
  • 14