panva / openid-client

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

multiple redirect_uris #274

Closed frantzyy closed 4 years ago

frantzyy commented 4 years ago

I'm using this package in a front end gateway that can handle multiple hostnames.

I'm able to register the multiple redirect uris with my IDP and I'm able to configure my Client with the multiple redirect uris.

I don't understand how to get the Strategy to use the right uris (hostname) when authenticating the request. I was hoping for something similar to the Facebook Strategy where I can pass a relative url ("/auth/redirect") but it doesn't seem like this package works like that.

I really don't want to create a Strategy for each possible redirect uri I have then then add logic to check the current request's hostname to determine which Strategy to use. I feel like I'm missing something.

panva commented 4 years ago

pass the redirect uri you want to use to the passport authenticate call. e.g. https://github.com/panva/node-openid-client/pull/132#issuecomment-432924093

frantzyy commented 4 years ago

ok I see how that is working but it can't be a relative path which I guess is implied by a uri.

So I just need to add some logic to pull hostname from the request before passing it to the authenticate call.

Thank you for the quick reply and effort to maintain this library.

panva commented 4 years ago

Please consider supporting the library if it provides value to you or your company and this support was of help to you. Supporting the library means, amongst other things, that such support will be available in the future.