Class HttpBasicAuthProvider
java.lang.Object
io.helidon.security.providers.httpauth.HttpBasicAuthProvider
- All Implemented Interfaces:
AuthenticationProvider, OutboundSecurityProvider, SecurityProvider
public class HttpBasicAuthProvider
extends Object
implements AuthenticationProvider, OutboundSecurityProvider
Http authentication security provider.
Provides support for username and password authentication, with support for roles list.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(ProviderRequest providerRequest) Authenticate a request.builder()Get a builder instance to construct a new security provider.static HttpBasicAuthProviderLoad this provider from configuration.booleanisOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outbondEnv, EndpointConfig outboundEp) Check if the path to be executed is supported by this security provider.outboundSecurity(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEp) Creates necessary updates to headers and entity needed for outbound security (e.g.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SecurityProvider
supportedAnnotations, supportedAttributes, supportedConfigKeys, supportedCustomObjectsModifier and TypeMethodDescriptiondefault Collection<Class<? extends Annotation>> Provide extension annotations supported by this provider (e.g.default Collection<String> A collection of attribute names expected by this provider to override endpoint configuration.default Collection<String> Keys expected in configuration.default Collection<Class<? extends ProviderConfig>> Class of the configuration type.
-
Method Details
-
builder
Get a builder instance to construct a new security provider. Alternative approach iscreate(Config).- Returns:
- builder to fluently construct Basic security provider
-
create
Load this provider from configuration.- Parameters:
config- Configuration located at this provider's configuration (e.g. child is http-basic-auth)- Returns:
- instance of provider configured from provided config
-
isOutboundSupported
public boolean isOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outbondEnv, EndpointConfig outboundEp) Description copied from interface:OutboundSecurityProviderCheck if the path to be executed is supported by this security provider. Defaults to true.- Specified by:
isOutboundSupportedin interfaceOutboundSecurityProvider- Parameters:
providerRequest- context with environment, subject(s) etc. that was receivedoutbondEnv- environment for outbound calloutboundEp- outbound endpoint configuration- Returns:
- true if this identity propagator can generate required headers for the path defined
-
outboundSecurity
public OutboundSecurityResponse outboundSecurity(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEp) Description copied from interface:OutboundSecurityProviderCreates necessary updates to headers and entity needed for outbound security (e.g. identity propagation, s2s security etc.). This method will be invoked for outbound requests ONLY.- Specified by:
outboundSecurityin interfaceOutboundSecurityProvider- Parameters:
providerRequest- context with environment, subject(s) etc. that was receivedoutboundEnv- environment for outbound calloutboundEp- outbound endpoint configuration- Returns:
- response with generated headers and other possible configuration
- See Also:
-
authenticate
Description copied from interface:AuthenticationProviderAuthenticate a request. This may be just resolving headers (tokens) or full authentication (basic auth). Do not throw exception for normal processing (e.g. invalid credentials; you may throw an exception in case of misconfiguration). This method will be invoked for inbound requests ONLY.This method must provide either a
Principalor a wholeSubjecteither for a user or for service (or both).- Specified by:
authenticatein interfaceAuthenticationProvider- Parameters:
providerRequest- context of this security enforcement/validation- Returns:
- response that either authenticates the request, fails authentication or abstains from authentication
- See Also:
-