Search in sources :

Example 16 with IDXResponse

use of com.okta.idx.sdk.api.response.IDXResponse in project okta-idx-java by okta.

the class AuthenticationTransaction method fillOutIdps.

private void fillOutIdps(AuthenticationResponse authenticationResponse) {
    if (idxResponse == null || idxResponse.remediation() == null) {
        return;
    }
    List<Idp> idpList = new LinkedList<>();
    RemediationOption[] remediationOptions = this.getResponse().remediation().remediationOptions();
    List<RemediationOption> remediationOptionList = Arrays.stream(remediationOptions).filter(x -> "redirect-idps".equals(x.getName()) || "redirect-idp".equals(x.getName())).collect(Collectors.toList());
    for (RemediationOption remediationOption : remediationOptionList) {
        idpList.add(new Idp(remediationOption.getType(), remediationOption.getHref()));
    }
    authenticationResponse.setIdps(idpList);
}
Also used : Arrays(java.util.Arrays) OptionsForm(com.okta.idx.sdk.api.model.OptionsForm) AuthenticationResponse(com.okta.idx.sdk.api.response.AuthenticationResponse) CurrentAuthenticatorEnrollment(com.okta.idx.sdk.api.model.CurrentAuthenticatorEnrollment) LoggerFactory(org.slf4j.LoggerFactory) ProcessingException(com.okta.idx.sdk.api.exception.ProcessingException) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Options(com.okta.idx.sdk.api.model.Options) Locale(java.util.Locale) IDXResponse(com.okta.idx.sdk.api.response.IDXResponse) Map(java.util.Map) LinkedList(java.util.LinkedList) Assert(com.okta.commons.lang.Assert) Logger(org.slf4j.Logger) RemediationOption(com.okta.idx.sdk.api.model.RemediationOption) FormValue(com.okta.idx.sdk.api.model.FormValue) RemediationType(com.okta.idx.sdk.api.model.RemediationType) AuthenticationStatus(com.okta.idx.sdk.api.model.AuthenticationStatus) Response(com.okta.commons.http.Response) CurrentAuthenticatorEnrollmentValue(com.okta.idx.sdk.api.model.CurrentAuthenticatorEnrollmentValue) EmailTokenType(com.okta.idx.sdk.api.model.EmailTokenType) Collectors(java.util.stream.Collectors) List(java.util.List) IDXClientContext(com.okta.idx.sdk.api.model.IDXClientContext) TokenResponse(com.okta.idx.sdk.api.response.TokenResponse) Optional(java.util.Optional) Idp(com.okta.idx.sdk.api.model.Idp) PollInfo(com.okta.idx.sdk.api.model.PollInfo) Idp(com.okta.idx.sdk.api.model.Idp) RemediationOption(com.okta.idx.sdk.api.model.RemediationOption) LinkedList(java.util.LinkedList)

Aggregations

IDXResponse (com.okta.idx.sdk.api.response.IDXResponse)16 ProcessingException (com.okta.idx.sdk.api.exception.ProcessingException)12 Response (com.okta.commons.http.Response)11 IdentifyRequest (com.okta.idx.sdk.api.request.IdentifyRequest)11 RecoverRequest (com.okta.idx.sdk.api.request.RecoverRequest)11 TokenResponse (com.okta.idx.sdk.api.response.TokenResponse)11 JsonNode (com.fasterxml.jackson.databind.JsonNode)10 DefaultRequest (com.okta.commons.http.DefaultRequest)10 HttpException (com.okta.commons.http.HttpException)10 Request (com.okta.commons.http.Request)10 AnswerChallengeRequest (com.okta.idx.sdk.api.request.AnswerChallengeRequest)10 CancelRequest (com.okta.idx.sdk.api.request.CancelRequest)10 ChallengeRequest (com.okta.idx.sdk.api.request.ChallengeRequest)10 EnrollRequest (com.okta.idx.sdk.api.request.EnrollRequest)10 EnrollUserProfileUpdateRequest (com.okta.idx.sdk.api.request.EnrollUserProfileUpdateRequest)10 IntrospectRequest (com.okta.idx.sdk.api.request.IntrospectRequest)10 PollRequest (com.okta.idx.sdk.api.request.PollRequest)10 SkipAuthenticatorEnrollmentRequest (com.okta.idx.sdk.api.request.SkipAuthenticatorEnrollmentRequest)10 ErrorResponse (com.okta.idx.sdk.api.response.ErrorResponse)10 InteractResponse (com.okta.idx.sdk.api.response.InteractResponse)10