Search in sources :

Example 1 with Idp

use of com.okta.idx.sdk.api.model.Idp 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

Response (com.okta.commons.http.Response)1 Assert (com.okta.commons.lang.Assert)1 ProcessingException (com.okta.idx.sdk.api.exception.ProcessingException)1 AuthenticationStatus (com.okta.idx.sdk.api.model.AuthenticationStatus)1 CurrentAuthenticatorEnrollment (com.okta.idx.sdk.api.model.CurrentAuthenticatorEnrollment)1 CurrentAuthenticatorEnrollmentValue (com.okta.idx.sdk.api.model.CurrentAuthenticatorEnrollmentValue)1 EmailTokenType (com.okta.idx.sdk.api.model.EmailTokenType)1 FormValue (com.okta.idx.sdk.api.model.FormValue)1 IDXClientContext (com.okta.idx.sdk.api.model.IDXClientContext)1 Idp (com.okta.idx.sdk.api.model.Idp)1 Options (com.okta.idx.sdk.api.model.Options)1 OptionsForm (com.okta.idx.sdk.api.model.OptionsForm)1 PollInfo (com.okta.idx.sdk.api.model.PollInfo)1 RemediationOption (com.okta.idx.sdk.api.model.RemediationOption)1 RemediationType (com.okta.idx.sdk.api.model.RemediationType)1 AuthenticationResponse (com.okta.idx.sdk.api.response.AuthenticationResponse)1 IDXResponse (com.okta.idx.sdk.api.response.IDXResponse)1 TokenResponse (com.okta.idx.sdk.api.response.TokenResponse)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1