Class HttpBasicAuthProvider
- java.lang.Object
-
- io.helidon.security.spi.SynchronousProvider
-
- io.helidon.security.providers.httpauth.HttpBasicAuthProvider
-
- All Implemented Interfaces:
AuthenticationProvider,OutboundSecurityProvider,SecurityProvider
public class HttpBasicAuthProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider
Http authentication security provider. Provides support for username and password authentication, with support for roles list.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpBasicAuthProvider.BuilderHttpBasicAuthProviderfluent API builder.
-
Field Summary
Fields Modifier and Type Field Description static StringEP_PROPERTY_OUTBOUND_PASSWORDConfigure this for outbound requests to override password to use.static StringEP_PROPERTY_OUTBOUND_USERConfigure this for outbound requests to override user to use.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HttpBasicAuthProvider.Builderbuilder()Get a builder instance to construct a new security provider.static HttpBasicAuthProvidercreate(Config config)Load this provider from configuration.booleanisOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outbondEnv, EndpointConfig outboundEp)Check if the path to be executed is supported by this security provider.protected AuthenticationResponsesyncAuthenticate(ProviderRequest providerRequest)Synchronous authentication.protected OutboundSecurityResponsesyncOutbound(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEp)Synchronous outbound security.-
Methods inherited from class io.helidon.security.spi.SynchronousProvider
authenticate, authorize, outboundSecurity, syncAuthorize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.security.spi.AuthenticationProvider
authenticate
-
Methods inherited from interface io.helidon.security.spi.OutboundSecurityProvider
outboundSecurity
-
Methods inherited from interface io.helidon.security.spi.SecurityProvider
supportedAnnotations, supportedAttributes, supportedConfigKeys, supportedCustomObjects
-
-
-
-
Field Detail
-
EP_PROPERTY_OUTBOUND_USER
public static final String EP_PROPERTY_OUTBOUND_USER
Configure this for outbound requests to override user to use.- See Also:
- Constant Field Values
-
EP_PROPERTY_OUTBOUND_PASSWORD
public static final String EP_PROPERTY_OUTBOUND_PASSWORD
Configure this for outbound requests to override password to use.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static HttpBasicAuthProvider.Builder builder()
Get a builder instance to construct a new security provider. Alternative approach iscreate(Config)(orcreate(Config)).- Returns:
- builder to fluently construct Basic security provider
-
create
public static HttpBasicAuthProvider create(Config config)
Load this provider from configuration.- Parameters:
config- Configuration located at this provider's configuration (e.g. child is either http-basic-auth or http-digest-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
-
syncOutbound
protected OutboundSecurityResponse syncOutbound(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEp)
Description copied from class:SynchronousProviderSynchronous outbound security.- Overrides:
syncOutboundin classSynchronousProvider- Parameters:
providerRequest- context with environment, subject(s) etc.outboundEnv- environment of this outbound calloutboundEp- endpoint config for outbound call- Returns:
- outbound response
- See Also:
OutboundSecurityProvider.outboundSecurity(ProviderRequest, SecurityEnvironment, EndpointConfig),OutboundSecurityProvider.isOutboundSupported(ProviderRequest, SecurityEnvironment, EndpointConfig)
-
syncAuthenticate
protected AuthenticationResponse syncAuthenticate(ProviderRequest providerRequest)
Description copied from class:SynchronousProviderSynchronous authentication.- Overrides:
syncAuthenticatein classSynchronousProvider- Parameters:
providerRequest- context with environment, subject(s) etc.- Returns:
- authentication response
- See Also:
AuthenticationProvider.authenticate(ProviderRequest)
-
-