use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.
the class BaseIDXClient method challenge.
@Override
public IDXResponse challenge(ChallengeRequest challengeRequest, String href) throws ProcessingException {
IDXResponse idxResponse;
try {
Request request = new DefaultRequest(HttpMethod.POST, href, null, getHttpHeaders(false), new ByteArrayInputStream(objectMapper.writeValueAsBytes(challengeRequest)), -1L);
Response response = requestExecutor.executeRequest(request);
if (response.getHttpStatus() != 200) {
handleErrorResponse(request, response);
}
JsonNode responseJsonNode = objectMapper.readTree(response.getBody());
idxResponse = objectMapper.convertValue(responseJsonNode, IDXResponse.class);
} catch (IOException | HttpException e) {
throw new ProcessingException(e);
}
return idxResponse;
}
use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.
the class BaseIDXClient method identify.
@Override
public IDXResponse identify(IdentifyRequest identifyRequest, String href) throws ProcessingException {
IDXResponse idxResponse;
try {
Request request = new DefaultRequest(HttpMethod.POST, href, null, getHttpHeaders(false), new ByteArrayInputStream(objectMapper.writeValueAsBytes(identifyRequest)), -1L);
Response response = requestExecutor.executeRequest(request);
if (response.getHttpStatus() != 200) {
handleErrorResponse(request, response);
}
JsonNode responseJsonNode = objectMapper.readTree(response.getBody());
idxResponse = objectMapper.convertValue(responseJsonNode, IDXResponse.class);
} catch (IOException | HttpException e) {
throw new ProcessingException(e);
}
return idxResponse;
}
use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.
the class BaseIDXClient method enroll.
@Override
public IDXResponse enroll(EnrollRequest enrollRequest, String href) throws ProcessingException {
IDXResponse idxResponse;
try {
Request request = new DefaultRequest(HttpMethod.POST, href, null, getHttpHeaders(false), new ByteArrayInputStream(objectMapper.writeValueAsBytes(enrollRequest)), -1L);
Response response = requestExecutor.executeRequest(request);
if (response.getHttpStatus() != 200) {
handleErrorResponse(request, response);
}
JsonNode responseJsonNode = objectMapper.readTree(response.getBody());
idxResponse = objectMapper.convertValue(responseJsonNode, IDXResponse.class);
} catch (IOException | HttpException e) {
throw new ProcessingException(e);
}
return idxResponse;
}
use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.
the class AuthenticationTransaction method proceed.
AuthenticationTransaction proceed(Factory factory) throws ProcessingException {
IDXResponse idxResponse = factory.create();
WrapperUtil.printRemediationOptions(idxResponse);
WrapperUtil.printMessage(idxResponse);
return new AuthenticationTransaction(client, clientContext, idxResponse);
}
use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.
the class AuthenticationTransaction method proceed.
static AuthenticationTransaction proceed(IDXClient client, ProceedContext proceedContext, Factory factory) throws ProcessingException {
IDXResponse idxResponse = factory.create();
WrapperUtil.printRemediationOptions(idxResponse);
WrapperUtil.printMessage(idxResponse);
return new AuthenticationTransaction(client, proceedContext.getClientContext(), idxResponse);
}
Aggregations