use of org.xdi.oxauth.client.RegisterClient in project oxAuth by GluuFederation.
the class RegistrationRestWebServiceHttpTest method requestClientRegistrationFail3.
@Test
public void requestClientRegistrationFail3() throws Exception {
showTitle("requestClientRegistrationFail3");
RegisterClient registerClient = new RegisterClient(registrationEndpoint);
RegisterResponse response = registerClient.execRegister(ApplicationType.WEB, "oxAuth test app", Arrays.asList("https://client.example.com/cb#fail_fragment"));
showClient(registerClient);
assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity());
assertNotNull(response.getEntity(), "The entity is null");
assertNotNull(response.getErrorType(), "The error type is null");
assertNotNull(response.getErrorDescription(), "The error description is null");
}
use of org.xdi.oxauth.client.RegisterClient in project oxAuth by GluuFederation.
the class RegistrationRestWebServiceHttpTest method requestClientRegistrationFail2.
@Test
public void requestClientRegistrationFail2() throws Exception {
showTitle("requestClientRegistrationFail2");
RegisterClient registerClient = new RegisterClient(registrationEndpoint);
// Missing redirect URIs
RegisterResponse response = registerClient.execRegister(ApplicationType.WEB, "oxAuth test app", null);
showClient(registerClient);
assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity());
assertNotNull(response.getEntity(), "The entity is null");
assertNotNull(response.getErrorType(), "The error type is null");
assertNotNull(response.getErrorDescription(), "The error description is null");
}
use of org.xdi.oxauth.client.RegisterClient in project oxTrust by GluuFederation.
the class OpenIdClient method registerOpenIdClient.
private RegisterResponse registerOpenIdClient() {
logger.info("Registering OpenId client");
String clientName = this.appConfiguration.getApplicationName() + " client";
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, clientName, Arrays.asList(this.appConfiguration.getOpenIdRedirectUrl()));
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.RS256);
registerRequest.setTokenEndpointAuthMethod(AuthenticationMethod.CLIENT_SECRET_BASIC);
RegisterClient registerClient = new RegisterClient(openIdConfiguration.getRegistrationEndpoint());
registerClient.setRequest(registerRequest);
RegisterResponse response = registerClient.exec();
if ((response == null) || (response.getStatus() != 200)) {
throw new ConfigurationException("Failed to register new client");
}
return response;
}
Aggregations