Duende.AccessTokenManagement
Duende.AccessTokenManagement copied to clipboard
Consider allowing an Authority property on ClientCredentialsClient
This would be used to automatically access the discovery document to set TokenEndpoint internally (prolly in an IPostConfigureOptions).
Some work in progress is here: joe/wip/authority, but there is more complexity than I initially thought.
The issue comes down to, at what point do we perform discovery? Retrieving the disco document is asynchronous, so just the mechanics of where do you put that async operation is tricky to do without a breaking change. Also, there's potential caching problems - though right now we're only using discovery to set the token endpoint, and that shouldn't ever change.
Still to do in the WIP branch:
- Need to consider if we want to use discovery cache at all
- Tests are still failing, and making them pass will require reworking management of discovery cache (or its non-cached replacement)
- xmldoc needs to be written
- Need to consider how the oidc options interact with the new oauth option. Both have an authority, but don't behave the same. On the OIDC side, we use the option from the OIDC auth handler.