Search in sources :

Example 21 with ClientInterface

use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.

the class GetTokensByCodeTest method getToken_withES384.

@Parameters({ "host", "opHost", "redirectUrls", "userId", "userSecret" })
@Test
public void getToken_withES384(String host, String opHost, String redirectUrls, String userId, String userSecret) {
    ClientInterface client = Tester.newClient(host);
    final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, "ES384");
    GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString());
}
Also used : ClientInterface(io.jans.ca.client.ClientInterface) RegisterSiteResponse(io.jans.ca.common.response.RegisterSiteResponse) GetTokensByCodeResponse2(io.jans.ca.client.GetTokensByCodeResponse2) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Example 22 with ClientInterface

use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.

the class GetTokensByCodeTest method withAuthenticationMethod_shouldGetTokenInResponse.

@Parameters({ "host", "opHost", "redirectUrls", "userId", "userSecret" })
@Test
public void withAuthenticationMethod_shouldGetTokenInResponse(String host, String opHost, String redirectUrls, String userId, String userSecret) {
    ClientInterface client = Tester.newClient(host);
    final RegisterSiteResponse site = RegisterSiteTest.registerSite_withAuthenticationMethod(client, opHost, redirectUrls, "PS256", AuthenticationMethod.PRIVATE_KEY_JWT.toString());
    GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString(), AuthenticationMethod.PRIVATE_KEY_JWT.toString(), "PS256");
}
Also used : ClientInterface(io.jans.ca.client.ClientInterface) RegisterSiteResponse(io.jans.ca.common.response.RegisterSiteResponse) GetTokensByCodeResponse2(io.jans.ca.client.GetTokensByCodeResponse2) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Example 23 with ClientInterface

use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.

the class GetTokensByCodeTest method getToken_withPS256.

@Parameters({ "host", "opHost", "redirectUrls", "userId", "userSecret" })
@Test
public void getToken_withPS256(String host, String opHost, String redirectUrls, String userId, String userSecret) {
    ClientInterface client = Tester.newClient(host);
    final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, "PS256");
    GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString());
}
Also used : ClientInterface(io.jans.ca.client.ClientInterface) RegisterSiteResponse(io.jans.ca.common.response.RegisterSiteResponse) GetTokensByCodeResponse2(io.jans.ca.client.GetTokensByCodeResponse2) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Example 24 with ClientInterface

use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.

the class GetTokensByCodeTest method getToken_withPS512.

@Parameters({ "host", "opHost", "redirectUrls", "userId", "userSecret" })
@Test
public void getToken_withPS512(String host, String opHost, String redirectUrls, String userId, String userSecret) {
    ClientInterface client = Tester.newClient(host);
    final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, "PS512");
    GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString());
}
Also used : ClientInterface(io.jans.ca.client.ClientInterface) RegisterSiteResponse(io.jans.ca.common.response.RegisterSiteResponse) GetTokensByCodeResponse2(io.jans.ca.client.GetTokensByCodeResponse2) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Example 25 with ClientInterface

use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.

the class GetTokensByCodeTest method getToken_withNoneAlgo.

@Parameters({ "host", "opHost", "redirectUrls", "userId", "userSecret" })
@Test
public void getToken_withNoneAlgo(String host, String opHost, String redirectUrls, String userId, String userSecret) {
    ClientInterface client = Tester.newClient(host);
    final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, "none");
    GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString());
}
Also used : ClientInterface(io.jans.ca.client.ClientInterface) RegisterSiteResponse(io.jans.ca.common.response.RegisterSiteResponse) GetTokensByCodeResponse2(io.jans.ca.client.GetTokensByCodeResponse2) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Aggregations

ClientInterface (io.jans.ca.client.ClientInterface)67 Parameters (org.testng.annotations.Parameters)64 Test (org.testng.annotations.Test)64 RegisterSiteResponse (io.jans.ca.common.response.RegisterSiteResponse)58 GetTokensByCodeResponse2 (io.jans.ca.client.GetTokensByCodeResponse2)21 GetAuthorizationUrlParams (io.jans.ca.common.params.GetAuthorizationUrlParams)8 GetAuthorizationUrlResponse (io.jans.ca.common.response.GetAuthorizationUrlResponse)8 RpGetRptResponse (io.jans.ca.common.response.RpGetRptResponse)7 RsCheckAccessResponse (io.jans.ca.common.response.RsCheckAccessResponse)7 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 RpGetRptParams (io.jans.ca.common.params.RpGetRptParams)4 RsProtectParams2 (io.jans.ca.client.RsProtectParams2)3 GetIssuerParams (io.jans.ca.common.params.GetIssuerParams)3 RpGetClaimsGatheringUrlParams (io.jans.ca.common.params.RpGetClaimsGatheringUrlParams)3 GetIssuerResponse (io.jans.ca.common.response.GetIssuerResponse)3 RpGetClaimsGatheringUrlResponse (io.jans.ca.common.response.RpGetClaimsGatheringUrlResponse)3 BadRequestException (javax.ws.rs.BadRequestException)3 CorrectRptIntrospectionResponse (io.jans.ca.common.introspection.CorrectRptIntrospectionResponse)2 GetDiscoveryParams (io.jans.ca.common.params.GetDiscoveryParams)2 GetJwksParams (io.jans.ca.common.params.GetJwksParams)2