[
https://issues.jboss.org/browse/ELY-929?page=com.atlassian.jira.plugin.sy...
]
David Lloyd commented on ELY-929:
---------------------------------
The purpose is so that new instances of the callback handler can be instantiated for each
outbound authentication usage, instead of using one callback handler which is shared for
every authentication configuration.
However, this relies on some fragile semantics on behalf of the authentication context
client: do we construct a new callback handler on every authentication attempt, or do we
keep them around to be reused for all authentications for the same session or endpoint?
What semantics can the user expect from callback handlers constructed in this way? These
questions need to be answered definitively before we can do this.
Also, we have to consider equals/hashCode behavior. In order to reliably cache
connections, protocol implementors need the ability to know if a second usage is using the
same configuration as a first usage, to know if a separate authentication must be
performed or if an existing authentication can be reused. Using Supplier invites lambdas,
which have problematic equals/hashCode behavior, potentially breaking this contract and
causing many unnecessary authentications to be performed.
AuthenticationConfiguration uniqueness enhancements
---------------------------------------------------
Key: ELY-929
URL:
https://issues.jboss.org/browse/ELY-929
Project: WildFly Elytron
Issue Type: Enhancement
Components: Authentication Client
Reporter: David Lloyd
Fix For: 1.2.0.Beta12
Apply some enhancements to AuthenticationConfiguration uniqueness.
* Add admonishing JavaDoc to {{useCallbackHandler}} to point out the importance of
per-identity uniqueness of the callback handler
The following also may be possible and useful:
* Modify the {{AuthenticationConfiguration}} process to capture instances for
{{Supplier}}-driven components at the time the configuration is used via the
{{AuthenticationContextConfigurationClient}}
* Add a variation of {{useCallbackHandler}} which accepts a
{{Supplier<CallbackHandler>}}, or a {{Function<T, CallbackHandler}} and a {{T}},
allowing constructor refs to be given
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)