Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy issue - Is it possible to expose the _oauth2 property, similar to the passport-oauth2 strategy? #74

Open
piyushsmantri opened this issue Jul 12, 2019 · 1 comment

Comments

@piyushsmantri
Copy link

I am trying to perform openid authentication behind a corporate proxy, and for that, I need to set the proxy options for the agent, similar to the following:

var HttpsProxyAgent = require('https-proxy-agent');
if (process.env['https_proxy']) {
 var httpsProxyAgent = new HttpsProxyAgent(process.env['https_proxy']);
 strategy._oauth2.setAgent(httpsProxyAgent);
}
passport.use(strategy);

I cannot perform this unless the ._oauth2 property is exposed.
Or is there any other way to configure the proxy options?

@pateldd1
Copy link

pateldd1 commented May 7, 2020

Git clone the whole repo and import it instead of the npm package.
In lib/strategy.js on line 414 do this from your code

 const oauth2Client = new OAuth2(config.clientID, config.clientSecret,
                    '', config.authorizationURL, config.tokenURL);
            oauth2Client.setAgent(httpsProxyAgent)
            return oauth2Client
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants