- All Known Implementing Classes:
CompositeProviderSelectionPolicy
public interface ProviderSelectionPolicy
A policy that selects provider to use.
To support loading from class name, this class must have a public constructor
that accepts
ProviderSelectionPolicy.Providers
as a single parameter, or a public constructor that
accepts ProviderSelectionPolicy.Providers
and Config
if you want your instance to be configurable.
To support configuring through a builder pattern, you must provide to security
builder a function that accepts ProviderSelectionPolicy.Providers
and returns an instance of this interface,
which could be the constructor itself.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Interface that is passed to a constructor of aProviderSelectionPolicy
implementation to supply all configured providers from security. -
Method Summary
Modifier and TypeMethodDescriptionSpecific method for outbound providers, as we have an option to choose the first outbound provider that matches the current request.<T extends SecurityProvider>
Optional<T> selectProvider
(Class<T> providerType) Select a provider instance of the type defined that this policy has configured as the default.<T extends SecurityProvider>
Optional<T> selectProvider
(Class<T> providerType, String requestedName) Select a provider instance of the type defined that this policy finds for the requested name.
-
Method Details
-
selectProvider
Select a provider instance of the type defined that this policy has configured as the default.- Type Parameters:
T
- type of provider- Parameters:
providerType
- type of provider (one ofAuthenticationProvider
,AuthorizationProvider
)- Returns:
- security provider instance
-
selectOutboundProviders
List<OutboundSecurityProvider> selectOutboundProviders()Specific method for outbound providers, as we have an option to choose the first outbound provider that matches the current request.- Returns:
- list of outbound provider to choose from (may be empty)
-
selectProvider
<T extends SecurityProvider> Optional<T> selectProvider(Class<T> providerType, String requestedName) Select a provider instance of the type defined that this policy finds for the requested name.- Type Parameters:
T
- type of provider- Parameters:
providerType
- type of provider (one ofAuthenticationProvider
,AuthorizationProvider
orOutboundSecurityProvider
)requestedName
- explicit provider name to find- Returns:
- security provider instance
-