Tabnine Logo
UrlJwkProvider.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.auth0.jwk.UrlJwkProvider
constructor

Best Java code snippets using com.auth0.jwk.UrlJwkProvider.<init> (Showing top 20 results out of 315)

origin: org.eclipse.che.multiuser/che-multiuser-keycloak-server

@Inject
public KeycloakJwkProvider(KeycloakSettings keycloakSettings) throws MalformedURLException {
 final String jwksUrl = keycloakSettings.get().get(KeycloakConstants.JWKS_ENDPOINT_SETTING);
 if (jwksUrl == null) {
  throw new ConfigurationException("Jwks endpoint url not found in keycloak settings");
 }
 this.jwkProvider = new GuavaCachedJwkProvider(new UrlJwkProvider(new URL(jwksUrl)));
}
origin: thomasdarimont/springio18-spring-keycloak

public Oauth2Client(TokensStore tokenStore, Oauth2Properties oauthProperties) throws Exception {
  this.tokenStore = tokenStore;
  this.oauthProperties = oauthProperties;
  RestTemplate rt = new RestTemplate();
  rt.getInterceptors().add(createClientAuthInterceptor(oauthProperties));
  this.oauthRestTemplate = rt;
  this.jwkProvider = new GuavaCachedJwkProvider(
      traceJwkLookupsOf(new UrlJwkProvider(new URL(oauthProperties.getJwksEndpoint()))));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldBuildCorrectHttpsUrlOnDomainWithHttps() {
  String httpsDomain = "https://samples.auth0.com";
  String actualJwksUrl = new UrlJwkProvider(httpsDomain).url.toString();
  assertThat(actualJwksUrl, equalTo(httpsDomain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldBuildCorrectHttpUrlOnDomainWithHttp() {
  String httpDomain = "http://samples.auth0.com";
  String actualJwksUrl = new UrlJwkProvider(httpDomain).url.toString();
  assertThat(actualJwksUrl, equalTo(httpDomain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldBuildCorrectHttpsUrlOnDomainWithHttpsAndSlash() {
  String httpsDomain = "https://samples.auth0.com";
  String httpsDomainWithSlash = httpsDomain + "/";
  String actualJwksUrl = new UrlJwkProvider(httpsDomainWithSlash).url.toString();
  assertThat(actualJwksUrl, equalTo(httpsDomain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldBuildCorrectHttpsUrlOnDomain() {
  String domain = "samples.auth0.com";
  String actualJwksUrl = new UrlJwkProvider(domain).url.toString();
  assertThat(actualJwksUrl, equalTo("https://" + domain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldWorkOnDomainWithSlash() {
  String domain = "samples.auth0.com";
  String domainWithSlash = domain + "/";
  String actualJwksUrl = new UrlJwkProvider(domainWithSlash).url.toString();
  assertThat(actualJwksUrl, equalTo("https://" + domain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldUseOnlyDomain() {
  String domain = "samples.auth0.com";
  String domainWithSubPath = domain + "/sub/path/";
  String actualJwksUrl = new UrlJwkProvider(domainWithSubPath).url.toString();
  assertThat(actualJwksUrl, equalTo("https://" + domain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailWithNegativeReadTimeout() throws MalformedURLException {
  expectedException.expect(IllegalArgumentException.class);
  new UrlJwkProvider(new URL("https://localhost"), null, -1);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldBuildCorrectHttpUrlOnDomainWithHttpAndSlash() {
  String httpDomain = "http://samples.auth0.com";
  String httpDomainWithSlash = httpDomain + "/";
  String actualJwksUrl = new UrlJwkProvider(httpDomainWithSlash).url.toString();
  assertThat(actualJwksUrl, equalTo(httpDomain + WELL_KNOWN_JWKS_PATH));
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailWithNegativeConnectTimeout() throws MalformedURLException {
  expectedException.expect(IllegalArgumentException.class);
  new UrlJwkProvider(new URL("https://localhost"), -1, null);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldReturnWithoutIdWhenSingleJwk() throws Exception {
  UrlJwkProvider provider = new UrlJwkProvider(getClass().getResource("/jwks-single-no-kid.json"));
  assertThat(provider.get(null), notNullValue());
  UrlJwkProvider provider2 = new UrlJwkProvider(getClass().getResource("/jwks-single.json"));
  assertThat(provider2.get(null), notNullValue());
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToLoadByDifferentIdWhenSingleJwk() throws Exception {
  expectedException.expect(SigningKeyNotFoundException.class);
  UrlJwkProvider provider = new UrlJwkProvider(getClass().getResource("/jwks-single-no-kid.json"));
  provider.get("wrong-kid");
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailOnInvalidProtocol() {
  expectedException.expect(IllegalArgumentException.class);
  String domainWithInvalidProtocol = "httptest://samples.auth0.com";
  new UrlJwkProvider(domainWithInvalidProtocol);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailWithNullUrl() {
  expectedException.expect(IllegalArgumentException.class);
  new UrlJwkProvider((URL) null);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToCreateWithNullDomain() {
  expectedException.expect(IllegalArgumentException.class);
  new UrlJwkProvider((String) null);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToLoadSingleWithoutIdWhenMultipleJwk() throws Exception {
  expectedException.expect(SigningKeyNotFoundException.class);
  UrlJwkProvider provider = new UrlJwkProvider(getClass().getResource("/jwks.json"));
  provider.get(null);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToLoadSingleWhenJsonIsInvalid() throws Exception {
  expectedException.expect(SigningKeyNotFoundException.class);
  UrlJwkProvider provider = new UrlJwkProvider(getClass().getResource("/invalid-jwks.json"));
  provider.get(KID);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToLoadSingleWhenUrlHasNothing() throws Exception {
  expectedException.expect(SigningKeyNotFoundException.class);
  UrlJwkProvider provider = new UrlJwkProvider(new URL("file:///not_found.file"));
  provider.get(KID);
}
origin: auth0/jwks-rsa-java

@Test
public void shouldFailToLoadSingleWhenKeysIsEmpty() throws Exception {
  expectedException.expect(SigningKeyNotFoundException.class);
  UrlJwkProvider provider = new UrlJwkProvider(getClass().getResource("/empty-jwks.json"));
  provider.get(KID);
}
com.auth0.jwkUrlJwkProvider<init>

Javadoc

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.

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"

Use #UrlJwkProvider(URL) if you need to pass a full URL.

Popular methods of UrlJwkProvider

  • get
  • getAll
  • getJwks
  • urlForDomain

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • startActivity (Activity)
  • setScale (BigDecimal)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • JTextField (javax.swing)
  • Option (scala)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now