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 use proxy when call authnetication provider #62

Closed oussamaABID closed 6 years ago

oussamaABID commented 6 years ago

hey

how to set company proxy for all feathers authnetication external call Example : when i call /auth/<provider> to logIn, how set proxy in feathers app, when this excute process call provider thx sorry for my english

daffl commented 6 years ago

You might find some information in https://github.com/jaredhanson/passport-oauth2/issues/59 and this Stackoverflow question.

oussamaABID commented 6 years ago

thx for help daffl, so i need add proxy in Strategy to override this._oauth2._agent

const FacebookStrategy = require('passport-facebook');
var HttpsProxyAgent = require('https-proxy-agent');
const proxy = {host:'http://proxy.fr',port:8080};
var agent = new HttpsProxyAgent(proxy);
FacebookStrategy._oauth2._agent = agent;

but my _oauth2 is not accessible :(

i check code of'passport-facebook', to find how to do it :)

daffl commented 6 years ago

You do have access to FacebookStrategy in src/authentication.js.

daffl commented 6 years ago

Closing assuming that this has been solved.

oussamaABID commented 6 years ago

sorry finaly i add proxy in my IDE . it's global setting Visual studio Code.

Note: Facebook Strategy work with real ip. localhost not working when i use proxy.