-
Notifications
You must be signed in to change notification settings - Fork 598
How can you 'configure' OpenIdConnectOptions CallbackPath? #1230
Comments
Yeah there's no support for PathStrings in the binder yet, I'll file an issue for this in Configuration |
What's dynamic about your CallbackPath such that you need to set it from config? |
I can probably get away with the default, for now. However, I would expect that all properties on "Options" types of objects to be able to be initialized via configuration. Perhaps that is a mistaken assumption on my part. The ultimate goal, is to be able to add new OpenId auth providers purely through configuration. If I have more than one OpenId provider, can they use the same callback endpoint? If not, I'll need to be able to configure it for each provider. |
OIDC providers should use unique callback paths. |
Right, that's what I was expecting. So, to accomplish what I'm trying to do I'll need to be able to configure the CallbackPath via configuration, which is not currently possible. |
Nevermind. I found a better solution; register a custom TypeConverter for PathString:
This appears to work, though it feels like this should be provided by the assembly that PathString belongs to. At least if someone else runs into this issue they can use this as a solution. |
I created an issue over in HttpAbstractions to track this, I'm assuming that will be the "fix". If you guys deem this worth fixing. |
Yeah PathString should be fixed since its basically a string+ primitive, binding should work for it |
@HaoK - can you close and link to the PR? |
I'm trying to set the OpenIdConnectOptions.CallbackPath through appsettings.json configuration, but it throws an exception when I attempt to access the IOptions Value property.
I can set this value in code, because there is an implicit conversion from string to PathString. Is there a way to set it through configuration?
The text was updated successfully, but these errors were encountered: