Skip to content

Submitting wrong passcode challenge produces successful result. Remediation messages are empty as well. #180

Description

@LoserAntbear

Describe the bug?

Greetings.
I've implemented user self-registration flow regarding code examples provided.
On the step of mobile phone verification user has to submit code challenge. Although, even if they supply wrong code challenge okta-idx proceeds with that as a successful result.

Generalised schematic description of the flow calls in the code: (I cannot provide actual code pieces, sorry)

// Resuming flow 
var resumeResult: OidcClientResult<IdxResponse> = IdxFlow.resume() ; //  OidcClientResult.Success
var response: IdxResponse = resumeResult.response;
------

// Providing passcode submitted by user
var remediation:  IdxRemediation =  response.remediations[IdxRemediation.Type.ENROLL_AUTHENTICATOR];
remediation.form["credentials.passcode"]?.value = passcode;
------

// proceeding with filled remediation form
when (val resumeResult = flow?.proceed(remediation)) {
      is OidcClientResult.Success -> {
          handleSuccess(resumeResult.result);
      }
      is OidcClientResult.Error -> {
          handleFailure(errorCode.toString(), resumeResult.exception);
      }
      else -> {
          handleFailure(errorCode.toString(), FlowProceedUnknownException("Unknown result"));
      }
  }

Despite wrong passcode is submitted (not the one, given in SMS) and api call returns 401 and form field with errors, okta does not result in OidcClientResult.Error, it produces OidcClientResult.Success.
okta_401

I've tried to access for messages to rely upon them in such case:

private fun  handleSuccess(result: IdxResponse) {
  if (result.messages.isNotEmpty()) {
      throw ResultMessagesNotEmpty(result.messages.messages.joinToString());
  }
}

But the messages collection is empty all the time.
Could you, please help me handle the case?

Note: the same process on swift is handled via OidcClientResult.Error (swift counterpart of it). I presumed that the process should match between platforms

What is expected to happen?

Okta produces OidcClientResult.Error when proceeding with remediation, which returns 401 code. Or okta populates related remediation messages.

What is the actual behavior?

Okta produces OidcClientResult.Success when proceeding with remediation, which returns 401 code. Remedation messages collection is empty.

Reproduction Steps?

Sadly, I cannot provide a repo due to security resctrictions, but the steps are described above in details.

Additional Information?

No response

SDK Version

okta-idx-kotlin:2.1.0

Build Information

gradle-7.5.1
com.android.tools.build:gradle:7.2.2

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions