Package io.helidon.microprofile.jwt.auth
Class JwtAuthProvider
java.lang.Object
io.helidon.microprofile.jwt.auth.JwtAuthProvider
- All Implemented Interfaces:
- AuthenticationProvider,- OutboundSecurityProvider,- SecurityProvider
public class JwtAuthProvider
extends Object
implements AuthenticationProvider, OutboundSecurityProvider
Provider that provides JWT authentication.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classFluent API builder forJwtAuthProvider.static classA custom object to configure specific handling of outbound calls.
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionauthenticate(ProviderRequest providerRequest) Authenticate a request.static JwtAuthProvider.Builderbuilder()A builder for this provider.static JwtAuthProviderCreate provider instance from configuration.booleanisOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundConfig) Check if the path to be executed is supported by this security provider.outboundSecurity(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEndpointConfig) Creates necessary updates to headers and entity needed for outbound security (e.g.Collection<Class<? extends Annotation>> Provide extension annotations supported by this provider (e.g.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.security.spi.SecurityProvidersupportedAttributes, supportedConfigKeys, supportedCustomObjects
- 
Field Details- 
CONFIG_EXPECTED_ISSUERConfiguration key for expected issuer of incoming tokens. Used for validation of JWT.- See Also:
 
- 
CONFIG_EXPECTED_AUDIENCESConfiguration key for expected audiences of incoming tokens. Used for validation of JWT.- See Also:
 
 
- 
- 
Method Details- 
builderA builder for this provider.- Returns:
- builder to create a new instance
 
- 
createCreate provider instance from configuration.- Parameters:
- config- configuration of this provider
- Returns:
- provider instance
 
- 
supportedAnnotationsDescription copied from interface:SecurityProviderProvide extension annotations supported by this provider (e.g.jakarta.annotation.security.RolesAllowed). Annotations will be collected according to framework in use. For JAX-RS, annotations from application class, resource class and resource methods will be collected.- Specified by:
- supportedAnnotationsin interface- SecurityProvider
- Returns:
- Collection of annotations this provider expects.
 
- 
authenticateDescription 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 interface- AuthenticationProvider
- Parameters:
- providerRequest- context of this security enforcement/validation
- Returns:
- response that either authenticates the request, fails authentication or abstains from authentication
- See Also:
 
- 
isOutboundSupportedpublic boolean isOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundConfig) Description copied from interface:OutboundSecurityProviderCheck if the path to be executed is supported by this security provider. Defaults to true.- Specified by:
- isOutboundSupportedin interface- OutboundSecurityProvider
- Parameters:
- providerRequest- context with environment, subject(s) etc. that was received
- outboundEnv- environment for outbound call
- outboundConfig- outbound endpoint configuration
- Returns:
- true if this identity propagator can generate required headers for the path defined
 
- 
outboundSecuritypublic OutboundSecurityResponse outboundSecurity(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEndpointConfig) 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 interface- OutboundSecurityProvider
- Parameters:
- providerRequest- context with environment, subject(s) etc. that was received
- outboundEnv- environment for outbound call
- outboundEndpointConfig- outbound endpoint configuration
- Returns:
- response with generated headers and other possible configuration
- See Also:
 
 
-