Support for multiple configurations within same process (Duende.AccessTokenManagement) #433
Replies: 1 comment 1 reply
-
|
Could you elaborate a bit more where exactly you would need more control in order to connect to the different authorization servers? The Duende.AccessTokenManagement is structured so that you can leverage the default, spec-compliant way of retrieving access tokens, and configure named token clients using the shared logic while setting client-specific options like the token endpoint URI etc. I've marked your question as a feature request, so that others can chime in and provide feedback on this as well. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When using client credentials token management with more than one client, it seems hard to implement isolated configurations.
Ie. AddClientCredentialsTokenManagement() only allows for one set of ClientCredentialTokenManagementOptions to be registered as well as all services registered in the DI-container allows only one implementation.
As an example, I use token management with two separate authorization servers, both requiring individual ClientCredentialTokenManagementOptions and custom implementations of IClientCredentialsTokenEndpoint. I can replace the default implementation for this interface in the DI-container, but it is hard with individual implementations for authorization servers.
I have solved this for now by implementing custom token managers, each decorating the token manager provided by the framework and injecting custom IClientCredentialsTokenEndpoint and ClientCredentialTokenManagementOptions by reflection.
This seems a bit hacky - does anyone have a better idea ?
Beta Was this translation helpful? Give feedback.
All reactions