panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Passport strategy and redirect_uri #133

Closed Themandunord closed 6 years ago

Themandunord commented 6 years ago

Hi guys πŸ˜€

I use the Passport strategy to use my openid connection.

I would like to know if I can have a dynamic redirect_uri to have a different behavior between two conditions.

During the creation of the Passport Strategy, we set the params field with the redirect_uri in it. It is possible to change this value?

Thanks

panva commented 6 years ago

https://github.com/panva/node-openid-client/pull/132#issuecomment-432924093

Not sure if this answers your question.

Themandunord commented 6 years ago

@panva Thanks for the answer. I don't know that we can do that, great :)

Another query is that I don't want to put the domain url in the environment variable or a config file. Because I have a lot of instance of my application that I need to deploy, and I don't know every time the target domain.

I know that I can get the url from the req object.

Do you see a possible solution of that? Or it is not possible to get the req object at this step.

panva commented 6 years ago

Look earlier in that thread, you can wrap around the call to authenticate.

Themandunord commented 6 years ago

Oh like that! Easy!

Thank you very much @panva πŸ‘

panva commented 6 years ago

You’re very welcome!