Package com.auth0.jwk
Class UrlJwkProvider
java.lang.Object
com.auth0.jwk.UrlJwkProvider
- All Implemented Interfaces:
JwkProvider
Jwk provider that loads them from a
URL-
Constructor Summary
ConstructorsConstructorDescriptionUrlJwkProvider(String domain) Creates a provider that loads from the given domain's well-known directory.UrlJwkProvider(URL url) Creates a provider that loads from the given URLUrlJwkProvider(URL url, Integer connectTimeout, Integer readTimeout) Creates a provider that loads from the given URLUrlJwkProvider(URL url, Integer connectTimeout, Integer readTimeout, Proxy proxy) Creates a provider that loads from the given URL using a specified proxy serverUrlJwkProvider(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. -
Method Summary
-
Constructor Details
-
UrlJwkProvider
Creates a provider that loads from the given URL- Parameters:
url- to load the jwks
-
UrlJwkProvider
Creates a provider that loads from the given URL using a specified proxy server- Parameters:
url- to load the jwksconnectTimeout- 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 jwksconnectTimeout- 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
Creates a provider that loads from the given URL- Parameters:
url- to load the jwksconnectTimeout- connection timeout in milliseconds (null for default)readTimeout- read timeout in milliseconds (null for default)
-
UrlJwkProvider
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"
UseUrlJwkProvider(URL)if you need to pass a full URL.- Parameters:
domain- where jwks is published
-
-
Method Details
-
getAll
- Throws:
SigningKeyNotFoundException
-
get
Description copied from interface:JwkProviderAttempts to get a JWK using the Key ID value. Note that implementations are synchronous (blocking).- Specified by:
getin interfaceJwkProvider- Parameters:
keyId- value of the kid found in a JWT- Returns:
- a JWK
- Throws:
SigningKeyNotFoundException- if no jwk can be found using the given kidJwkException
-