Class GenericJWKURLResolver

java.lang.Object
io.inverno.mod.security.jose.internal.jwk.GenericJWKURLResolver
All Implemented Interfaces:
JWKURLResolver

public class GenericJWKURLResolver extends Object implements JWKURLResolver

Generic JSON Web Key URL resolver implementation.

This is an overridable bean which can be overriden by injecting a custom JWKURLResolver instance when building the JOSE module.

The URL resolution will be disabled if the optional resource service is missing.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • GenericJWKURLResolver

      public GenericJWKURLResolver(com.fasterxml.jackson.databind.ObjectMapper mapper)

      Creates a generic JWK URL resolver.

      Parameters:
      mapper - an object mapper
  • Method Details

    • setResourceService

      public void setResourceService(ResourceService resourceService)

      Sets the resource service.

      Parameters:
      resourceService - a resource service
    • resolveJWKSetURL

      public org.reactivestreams.Publisher<Map<String,Object>> resolveJWKSetURL(URI jku) throws JWKResolveException
      Description copied from interface: JWKURLResolver

      Resolves a JSON JWK or JWK set at the specified location and returns corresponding keys represented as maps.

      Specified by:
      resolveJWKSetURL in interface JWKURLResolver
      Parameters:
      jku - the URI of the JSON JWK or JWK set resource
      Returns:
      a publisher of parsed keys represented as maps
      Throws:
      JWKResolveException - if there was an error resolving the resource
    • resolveX509CertificateURL

      public reactor.core.publisher.Mono<List<X509Certificate>> resolveX509CertificateURL(URI x5u) throws JWKResolveException
      Description copied from interface: JWKURLResolver

      Resolves the X.509 certificates chain at the specified location as defined by RFC7515 Section 4.1.5

      Specified by:
      resolveX509CertificateURL in interface JWKURLResolver
      Parameters:
      x5u - the URI of the X.509 certificate chain
      Returns:
      a single X.509 certificates chain publisher
      Throws:
      JWKResolveException - if there was an error resolving the certificates chain