Dynamic Providers - Make it easier to add custom IdentityProvider #350
maartenba
started this conversation in
Feature requests
Replies: 1 comment
-
|
The current design invites to replacing the built in EF-backed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dynamic Providers are quite extensible already, but some things could be made a little bit easier:
1 - The
IdentityProviderclass has no parameterless constructor, which makes a customICache<>for identity providers harder to implement. For example when using JSON to deserialize, this always needs a custom deserializer for the type.2 - When registering a dynamic provider that is not the default
OidcProvider, it is not straightforward to register a customIdentityProviderclass.As an example, when you register a
GoogleIdentityProvider, this would typically look like the following:When challenging the "google" scheme, you will see
GoogleDynamicConfigureOptions.Configureis never invoked and the handler will throw because noGoogleOptionsare configured.The reason for this is in the default EF Core-backed
IdentityProviderStore, theMapIdp()method currently returnsnullfor providers other thanOidcProvider(see code here).A solution is to override
IdentityProviderStoreand implementMapIdp()to support all dynamic provider types in the solution. This works, but is not straightforward.A suggestion would be to have
MapIdp()work with injectedIIdentityProviderMapperinstances or similar, where customIdentityProvidertypes can be mapped by registering a mapper for them.Beta Was this translation helpful? Give feedback.
All reactions