Package io.helidon.microprofile.jwt.auth
Class JwtAuthProvider
java.lang.Object
io.helidon.security.spi.SynchronousProvider
io.helidon.microprofile.jwt.auth.JwtAuthProvider
- All Implemented Interfaces:
AuthenticationProvider
,OutboundSecurityProvider
,SecurityProvider
public class JwtAuthProvider
extends SynchronousProvider
implements AuthenticationProvider, OutboundSecurityProvider
Provider that provides JWT authentication.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fluent API builder forJwtAuthProvider
.static class
A custom object to configure specific handling of outbound calls. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JwtAuthProvider.Builder
builder()
A builder for this provider.static JwtAuthProvider
Create provider instance from configuration.boolean
isOutboundSupported
(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundConfig) Check if the path to be executed is supported by this security provider.Collection<Class<? extends Annotation>>
Provide extension annotations supported by this provider (e.g.protected AuthenticationResponse
syncAuthenticate
(ProviderRequest providerRequest) Synchronous authentication.syncOutbound
(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEndpointConfig) 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
supportedAttributes, supportedConfigKeys, supportedCustomObjects
-
Field Details
-
EP_PROPERTY_OUTBOUND_USER
Deprecated, for removal: This API element is subject to removal in a future version.useEndpointConfig.PROPERTY_OUTBOUND_ID
instead, the value will change in 4.x as wellConfigure this for outbound requests to override user to use.- See Also:
-
CONFIG_EXPECTED_ISSUER
Configuration key for expected issuer of incoming tokens. Used for validation of JWT.- See Also:
-
CONFIG_EXPECTED_AUDIENCES
Configuration key for expected audiences of incoming tokens. Used for validation of JWT.- See Also:
-
-
Method Details
-
builder
A builder for this provider.- Returns:
- builder to create a new instance
-
create
Create provider instance from configuration.- Parameters:
config
- configuration of this provider- Returns:
- provider instance
-
supportedAnnotations
Description copied from interface:SecurityProvider
Provide 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:
supportedAnnotations
in interfaceSecurityProvider
- Returns:
- Collection of annotations this provider expects.
-
syncAuthenticate
Description copied from class:SynchronousProvider
Synchronous authentication.- Overrides:
syncAuthenticate
in classSynchronousProvider
- Parameters:
providerRequest
- context with environment, subject(s) etc.- Returns:
- authentication response
- See Also:
-
isOutboundSupported
public boolean isOutboundSupported(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundConfig) Description copied from interface:OutboundSecurityProvider
Check if the path to be executed is supported by this security provider. Defaults to true.- Specified by:
isOutboundSupported
in interfaceOutboundSecurityProvider
- Parameters:
providerRequest
- context with environment, subject(s) etc. that was receivedoutboundEnv
- environment for outbound calloutboundConfig
- outbound endpoint configuration- Returns:
- true if this identity propagator can generate required headers for the path defined
-
syncOutbound
public OutboundSecurityResponse syncOutbound(ProviderRequest providerRequest, SecurityEnvironment outboundEnv, EndpointConfig outboundEndpointConfig) Description copied from class:SynchronousProvider
Synchronous outbound security.- Overrides:
syncOutbound
in classSynchronousProvider
- Parameters:
providerRequest
- context with environment, subject(s) etc.outboundEnv
- environment of this outbound calloutboundEndpointConfig
- endpoint config for outbound call- Returns:
- outbound response
- See Also:
-
EndpointConfig.PROPERTY_OUTBOUND_ID
instead, the value will change in 4.x as well