jaredhanson/passport-openid — pull request #15 by dpolivaev (2013-03-30 22:06:20+00:00)
Title: Creating the OpenIDStrategy when request is available

Hello,

above all thank you very much for work and sharing of your middleware, I like it very much and find it really easy to use. I would like to make one suggestion.

Configuring open id strategy requires knowledge of host URL used to define returnURL and realm. These values are not always known a priory during the application development. They also can differ in test and productive environments. Therefore is seems to be an advantage if the strategy can be configured after the request containing the host URL is already available.

Therefore I changed your login example so that the strategy is set when the authentication request is processed. It means that a new strategy object is used every time.

I would like to ask you to check if it is a valid usage of your software. If it can be done this way may be you want to include my solution in your example. If something is wrong please give a hint what should be changed.

Kind regards,
Dimitry Polivaev