Search in sources :

Example 1 with GetDiscoveryResponse

use of io.jans.ca.common.response.GetDiscoveryResponse in project jans by JanssenProject.

the class GetDiscoveryTest method test.

@Parameters({ "host", "opHost", "opDiscoveryPath" })
@Test
public void test(String host, String opHost, String opDiscoveryPath) {
    ClientInterface client = Tester.newClient(host);
    final GetDiscoveryParams commandParams = new GetDiscoveryParams();
    commandParams.setOpHost(opHost);
    commandParams.setOpDiscoveryPath(opDiscoveryPath);
    final GetDiscoveryResponse resp = client.getDiscovery(commandParams);
    assertNotNull(resp);
    assertNotNull(resp.getIssuer());
}
Also used : GetDiscoveryResponse(io.jans.ca.common.response.GetDiscoveryResponse) ClientInterface(io.jans.ca.client.ClientInterface) GetDiscoveryParams(io.jans.ca.common.params.GetDiscoveryParams) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Example 2 with GetDiscoveryResponse

use of io.jans.ca.common.response.GetDiscoveryResponse in project jans by JanssenProject.

the class GetDiscoveryOperation method execute.

public IOpResponse execute(GetDiscoveryParams params) {
    OpenIdConfigurationResponse discoveryResponse = getDiscoveryService().getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath());
    GetDiscoveryResponse response = new GetDiscoveryResponse();
    try {
        BeanUtils.copyProperties(response, discoveryResponse);
        return response;
    } catch (IllegalAccessException | InvocationTargetException e) {
        LOG.error("Error in creating op discovery configuration response ", e);
    }
    throw new HttpException(ErrorResponseCode.FAILED_TO_GET_DISCOVERY);
}
Also used : GetDiscoveryResponse(io.jans.ca.common.response.GetDiscoveryResponse) OpenIdConfigurationResponse(io.jans.as.client.OpenIdConfigurationResponse) HttpException(io.jans.ca.server.HttpException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 3 with GetDiscoveryResponse

use of io.jans.ca.common.response.GetDiscoveryResponse in project jans by JanssenProject.

the class GetDiscoveryTest method test_withOpConfigurationEndpoint.

@Parameters({ "host", "opConfigurationEndpoint" })
@Test
public void test_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint) {
    ClientInterface client = Tester.newClient(host);
    final GetDiscoveryParams commandParams = new GetDiscoveryParams();
    commandParams.setOpConfigurationEndpoint(opConfigurationEndpoint);
    final GetDiscoveryResponse resp = client.getDiscovery(commandParams);
    assertNotNull(resp);
    assertNotNull(resp.getIssuer());
}
Also used : GetDiscoveryResponse(io.jans.ca.common.response.GetDiscoveryResponse) ClientInterface(io.jans.ca.client.ClientInterface) GetDiscoveryParams(io.jans.ca.common.params.GetDiscoveryParams) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Aggregations

GetDiscoveryResponse (io.jans.ca.common.response.GetDiscoveryResponse)3 ClientInterface (io.jans.ca.client.ClientInterface)2 GetDiscoveryParams (io.jans.ca.common.params.GetDiscoveryParams)2 Parameters (org.testng.annotations.Parameters)2 Test (org.testng.annotations.Test)2 OpenIdConfigurationResponse (io.jans.as.client.OpenIdConfigurationResponse)1 HttpException (io.jans.ca.server.HttpException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1