Search in sources :

Example 6 with OpenIdConnectDiscoveryRequest

use of org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest in project oxAuth by GluuFederation.

the class OpenIDConnectDiscoveryHttpTest method hostNormalization2.

@Test
public void hostNormalization2() throws Exception {
    String resource = "example.com:8080";
    String expectedHost = "example.com:8080";
    String expectedPath = null;
    OpenIdConnectDiscoveryRequest openIdConnectDiscoveryRequest = new OpenIdConnectDiscoveryRequest(resource);
    assertEquals(openIdConnectDiscoveryRequest.getResource(), resource);
    assertEquals(openIdConnectDiscoveryRequest.getHost(), expectedHost);
    assertEquals(openIdConnectDiscoveryRequest.getPath(), expectedPath);
}
Also used : OpenIdConnectDiscoveryRequest(org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 7 with OpenIdConnectDiscoveryRequest

use of org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest in project oxAuth by GluuFederation.

the class OpenIDConnectDiscoveryHttpTest method emailNormalization2.

@Test
public void emailNormalization2() throws Exception {
    String resource = "joe@example.com";
    String expectedHost = "example.com";
    String expectedPath = null;
    OpenIdConnectDiscoveryRequest openIdConnectDiscoveryRequest = new OpenIdConnectDiscoveryRequest(resource);
    assertEquals(openIdConnectDiscoveryRequest.getResource(), resource);
    assertEquals(openIdConnectDiscoveryRequest.getHost(), expectedHost);
    assertEquals(openIdConnectDiscoveryRequest.getPath(), expectedPath);
}
Also used : OpenIdConnectDiscoveryRequest(org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 8 with OpenIdConnectDiscoveryRequest

use of org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest in project oxAuth by GluuFederation.

the class OpenIDConnectDiscoveryHttpTest method urlNormalization7.

@Test
public void urlNormalization7() throws Exception {
    String resource = "https://example.com:8080/joe?param1=foo&param2=bar#fragment";
    String expectedHost = "example.com:8080";
    String expectedPath = "/joe";
    OpenIdConnectDiscoveryRequest openIdConnectDiscoveryRequest = new OpenIdConnectDiscoveryRequest(resource);
    assertEquals(openIdConnectDiscoveryRequest.getResource(), resource);
    assertEquals(openIdConnectDiscoveryRequest.getHost(), expectedHost);
    assertEquals(openIdConnectDiscoveryRequest.getPath(), expectedPath);
}
Also used : OpenIdConnectDiscoveryRequest(org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 9 with OpenIdConnectDiscoveryRequest

use of org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest in project oxAuth by GluuFederation.

the class OpenIDConnectDiscoveryHttpTest method hostNormalization4.

@Test
public void hostNormalization4() throws Exception {
    String resource = "example.com:8080/path";
    String expectedHost = "example.com:8080";
    String expectedPath = "/path";
    OpenIdConnectDiscoveryRequest openIdConnectDiscoveryRequest = new OpenIdConnectDiscoveryRequest(resource);
    assertEquals(openIdConnectDiscoveryRequest.getResource(), resource);
    assertEquals(openIdConnectDiscoveryRequest.getHost(), expectedHost);
    assertEquals(openIdConnectDiscoveryRequest.getPath(), expectedPath);
}
Also used : OpenIdConnectDiscoveryRequest(org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 10 with OpenIdConnectDiscoveryRequest

use of org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest in project oxAuth by GluuFederation.

the class CanDiscoverIdentifiersUsingEMailSyntax method emailNormalization3.

@Test
public void emailNormalization3() throws Exception {
    String resource = "acct:joe@example.com:8080";
    String expectedHost = "example.com:8080";
    String expectedPath = null;
    OpenIdConnectDiscoveryRequest openIdConnectDiscoveryRequest = new OpenIdConnectDiscoveryRequest(resource);
    assertEquals(openIdConnectDiscoveryRequest.getResource(), resource);
    assertEquals(openIdConnectDiscoveryRequest.getHost(), expectedHost);
    assertEquals(openIdConnectDiscoveryRequest.getPath(), expectedPath);
}
Also used : OpenIdConnectDiscoveryRequest(org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest) Test(org.testng.annotations.Test)

Aggregations

OpenIdConnectDiscoveryRequest (org.xdi.oxauth.client.OpenIdConnectDiscoveryRequest)35 Test (org.testng.annotations.Test)34 BaseTest (org.xdi.oxauth.BaseTest)17 URISyntaxException (java.net.URISyntaxException)1 HttpClient (org.apache.http.client.HttpClient)1 ClientExecutor (org.jboss.resteasy.client.ClientExecutor)1 ApacheHttpClient4Executor (org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor)1 SslDefaultHttpClient (org.xdi.net.SslDefaultHttpClient)1 TrustAllTrustManager (org.xdi.net.TrustAllTrustManager)1 OpenIdConfigurationClient (org.xdi.oxauth.client.OpenIdConfigurationClient)1 OpenIdConfigurationResponse (org.xdi.oxauth.client.OpenIdConfigurationResponse)1 OpenIdConnectDiscoveryClient (org.xdi.oxauth.client.OpenIdConnectDiscoveryClient)1 OpenIdConnectDiscoveryResponse (org.xdi.oxauth.client.OpenIdConnectDiscoveryResponse)1