How can I set the Authority on OpenIdConnect middleware options dynamically?

后端 未结 2 1764
南笙
南笙 2020-12-03 08:59

We have multiple tenants, and they use different authorities (their own, not just standard providers). While I know how to dynamically set the clientId and secret, I can\'t

2条回答
  •  星月不相逢
    2020-12-03 09:26

    The Asp.NET Core model assumes one upstream authority per handler instance. My Saml2 component supports multiple upstream Idps in one handler and it has drawbacks in the rest of the system when that assumption no longer is true.

    In Asp.NET Core it is possible to add/remove providers at runtime, without requiring a restart. So I'd recommend finding a model based on that.

    If you rather want one handler that can have a per-request Authority setting, I think that a custom handler is needed - Microsoft's default implementation won't support that.

提交回复
热议问题