-
-
Notifications
You must be signed in to change notification settings - Fork 764
Added IdentityServerOptions.GetPublicHostName #302
Conversation
IdentityServerOptions.GetPublicHostName allows the host name to be configured at Request time, rather than at construction time.
I still don't get the motivation behind that feature - why do you need it? The Katana approach would be to have separate startup classes for different environments. |
The problem I'm having is that I don't know what the PublicHostName is of my machine at startup time. Of course, I'm new to OWIN/Katana so I probably have the workflow wrong... |
Why don't you know that? What's the scenario? |
I am deploying IdSrv on AppHarbor, and I have both a Test and Staging environment. The Staging environment is a staging point for a third setup on Amazon's EC2. And then of course there is the local development environment. In every case, at startup time I don't have a way of dynamically getting the name of the server. I can set it in the Web.config or via AppHarbor's configuration settings, but I still need to modify those setting wehn pushing to EC2. The only way I've figured out how to get the server name is at Request time from the OWIN context. I don't have any way to dynamically get it in the OWIN Startup function. Any suggestions would be greatly appreciated. Thanks! |
So the original reason I went down this road is because if PublicHostName is not set, it defaults to:
When I'm running in my Test / Staging environment on AH (or locally on Cassini), I don't have an SSL cert. What if IdentityServerOptions had a Scheme option that defaults to "https", or a UseSSL option that defaults to true? |
OK - we'll consider this. |
Just so that I understand - you deploy to all your environments using exactly the same code base - no configuration differences/transforms etc ? |
We modify web.config settings for external services (e.g. database connections) for a particular environment type. However, we deploy the same environment type to different host machines (e.g. the same Test configuration is run on AH for developer testing and EC2 for QA testing) |
Why did you close? |
Sorry, I should have commented on reasons for closing first. First, the pull request itself doesn't seem like the correct solution to the problem (specifying HTTP vs HTTPS when PublicHostName is not set) Second, there is a related feature request here: #341 |
IdentityServerOptions.GetPublicHostName allows the host name to be configured at Request time, rather than at construction time.
This provides a wider range of configuration options and is especially useful when multiple deployment environments are involved (e.g. local, unit test, test vs production, etc.)
Example: