java.lang.Object
io.helidon.security.spi.SynchronousProvider
io.helidon.security.providers.jwt.JwtProvider
All Implemented Interfaces:
io.helidon.security.spi.AuthenticationProvider, io.helidon.security.spi.OutboundSecurityProvider, io.helidon.security.spi.SecurityProvider

public final class JwtProvider extends io.helidon.security.spi.SynchronousProvider implements io.helidon.security.spi.AuthenticationProvider, io.helidon.security.spi.OutboundSecurityProvider
Provider that can process JWT tokens in request headers and assert identity (e.g. create a Principal for a SubjectType.USER or SubjectType.SERVICE. This provider can also propagate identity using JWT token, either by creating a new JWT or by propagating the existing token "as is". Verification and signatures of tokens is done through JWK standard - two separate JWK files are expected (one for verification, one for signatures).
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Fluent API builder for JwtProvider.
    static class 
    A custom object to configure specific handling of outbound calls.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Configure this for outbound requests to override user to use.
  • Method Summary

    Modifier and Type
    Method
    Description
    A builder for this provider.
    create(io.helidon.config.Config config)
    Create provider instance from configuration.
    boolean
    isOutboundSupported(io.helidon.security.ProviderRequest providerRequest, io.helidon.security.SecurityEnvironment outboundEnv, io.helidon.security.EndpointConfig outboundConfig)
     
    protected io.helidon.security.AuthenticationResponse
    syncAuthenticate(io.helidon.security.ProviderRequest providerRequest)
     
    protected io.helidon.security.OutboundSecurityResponse
    syncOutbound(io.helidon.security.ProviderRequest providerRequest, io.helidon.security.SecurityEnvironment outboundEnv, io.helidon.security.EndpointConfig outboundEndpointConfig)
     

    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 Details

    • EP_PROPERTY_OUTBOUND_USER

      public static final String EP_PROPERTY_OUTBOUND_USER
      Configure this for outbound requests to override user to use.
      See Also:
  • Method Details

    • builder

      public static JwtProvider.Builder builder()
      A builder for this provider.
      Returns:
      builder to create a new instance
    • create

      public static JwtProvider create(io.helidon.config.Config config)
      Create provider instance from configuration.
      Parameters:
      config - configuration of this provider
      Returns:
      provider instance
    • syncAuthenticate

      protected io.helidon.security.AuthenticationResponse syncAuthenticate(io.helidon.security.ProviderRequest providerRequest)
      Overrides:
      syncAuthenticate in class io.helidon.security.spi.SynchronousProvider
    • isOutboundSupported

      public boolean isOutboundSupported(io.helidon.security.ProviderRequest providerRequest, io.helidon.security.SecurityEnvironment outboundEnv, io.helidon.security.EndpointConfig outboundConfig)
      Specified by:
      isOutboundSupported in interface io.helidon.security.spi.OutboundSecurityProvider
    • syncOutbound

      protected io.helidon.security.OutboundSecurityResponse syncOutbound(io.helidon.security.ProviderRequest providerRequest, io.helidon.security.SecurityEnvironment outboundEnv, io.helidon.security.EndpointConfig outboundEndpointConfig)
      Overrides:
      syncOutbound in class io.helidon.security.spi.SynchronousProvider