Class URLBasedJWKSetSource<C extends SecurityContext>

  • All Implemented Interfaces:
    JWKSetSource<C>, java.io.Closeable, java.lang.AutoCloseable

    @ThreadSafe
    public class URLBasedJWKSetSource<C extends SecurityContext>
    extends java.lang.Object
    implements JWKSetSource<C>
    JWK set source that loads the keys from a URL, without health status reporting.
    Version:
    2022-11-22
    Author:
    Thomas Rørvik Skjølberg, Vladimir Dzhuvinov
    • Constructor Detail

      • URLBasedJWKSetSource

        public URLBasedJWKSetSource​(java.net.URL url,
                                    ResourceRetriever resourceRetriever)
        Creates a new URL based JWK set source.
        Parameters:
        url - The JWK set URL. Must not be null.
        resourceRetriever - The resource retriever to use. Must not be null.
    • Method Detail

      • getJWKSet

        public JWKSet getJWKSet​(JWKSetCacheRefreshEvaluator refreshEvaluator,
                                long currentTime,
                                C context)
                         throws KeySourceException
        Description copied from interface: JWKSetSource
        Gets the JWK set.
        Specified by:
        getJWKSet in interface JWKSetSource<C extends SecurityContext>
        Parameters:
        refreshEvaluator - Controls whether refresh of the JWK set cache (if utilised by the source) is required.
        currentTime - The current time, in milliseconds since the Unix epoch.
        context - Optional context, null if not required.
        Returns:
        The JWK set.
        Throws:
        KeySourceException - If JWK set retrieval failed.
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException