Package com.auth0.jwk

Class UrlJwkProvider

java.lang.Object
com.auth0.jwk.UrlJwkProvider
All Implemented Interfaces:
JwkProvider

public class UrlJwkProvider extends Object implements JwkProvider
Jwk provider that loads them from a URL
  • Constructor Details

    • UrlJwkProvider

      public UrlJwkProvider(URL url)
      Creates a provider that loads from the given URL
      Parameters:
      url - to load the jwks
    • UrlJwkProvider

      public UrlJwkProvider(URL url, Integer connectTimeout, Integer readTimeout, Proxy proxy)
      Creates a provider that loads from the given URL using a specified proxy server
      Parameters:
      url - to load the jwks
      connectTimeout - connection timeout in milliseconds (null for default)
      readTimeout - read timeout in milliseconds (null for default)
      proxy - proxy server to use when making the connection
    • UrlJwkProvider

      public UrlJwkProvider(URL url, Integer connectTimeout, Integer readTimeout, Proxy proxy, Map<String,String> headers)
      Creates a provider that loads from the given URL using custom request headers.
      Parameters:
      url - to load the jwks
      connectTimeout - connection timeout in milliseconds (default is null)
      readTimeout - read timeout in milliseconds (default is null)
      proxy - proxy server to use when making the connection (default is null)
      headers - a map of request header keys to values to send on the request. Default is "Accept: application/json".
    • UrlJwkProvider

      public UrlJwkProvider(URL url, Integer connectTimeout, Integer readTimeout)
      Creates a provider that loads from the given URL
      Parameters:
      url - to load the jwks
      connectTimeout - connection timeout in milliseconds (null for default)
      readTimeout - read timeout in milliseconds (null for default)
    • UrlJwkProvider

      public UrlJwkProvider(String domain)
      Creates a provider that loads from the given domain's well-known directory.

      It can be a url link 'https://samples.auth0.com' or just a domain 'samples.auth0.com'. If the protocol (http or https) is not provided then https is used by default. The default jwks path "/.well-known/jwks.json" is appended to the given string domain. If the domain url contains a path, e.g. 'https://auth.example.com/some-resource', the path is preserved and the default jwks path is appended.

      For example, when the domain is "samples.auth0.com" the jwks url that will be used is "https://samples.auth0.com/.well-known/jwks.json" If the domain string is "https://auth.example.com/some-resource", the jwks url that will be used is "https://auth.example.com/some-resource/.well-known/jwks.json"

      Use UrlJwkProvider(URL) if you need to pass a full URL.
      Parameters:
      domain - where jwks is published
  • Method Details