Skip to content

UserFactorApi enrollFactor throws a MismatchedInputException #1667

@bjjosef

Description

@bjjosef

Describe the bug?

Calling the UserFactorApi enrollFactor method results into a MismatchedInputException with the following Exception message:

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type com.okta.sdk.resource.model.HrefObject from Array value (token JsonToken.START_ARRAY)\n at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 255] (through reference chain: com.okta.sdk.resource.model.UserFactorSMS["_links"]->com.okta.sdk.resource.model.UserFactorLinks["resend"]

What is expected to happen?

UserFactorApi enrollFactor response mapped to the UserFactor object without any issue

What is the actual behavior?

MismatchedInputException encountered

Reproduction Steps?

private void enrollUserInFactor() throws ApiException {
        UserFactorApi userFactorApi = new UserFactorApi(client);

        UserFactorSMSProfile UserFactorSMSProfile = new UserFactorSMSProfile();
        UserFactorSMSProfile.setPhoneNumber("555 867 5309");

        UserFactorSMS UserFactorSMS = new UserFactorSMS();
        UserFactorSMS.setProvider(UserFactorProvider.OKTA.name());
        UserFactorSMS.setFactorType(UserFactorType.SMS);
        UserFactorSMS.setProfile(UserFactorSMSProfile);

        UserFactor userFactor = userFactorApi.enrollFactor("userId", UserFactorSMS, true, "templateId", 30, true, null);
    }

Additional Information?

No response

Java Version

openjdk 21.0.7 2025-04-15 LTS
OpenJDK Runtime Environment (build 21.0.7+9-LTS)
OpenJDK 64-Bit Server VM (build 21.0.7+9-LTS, mixed mode, sharing)

SDK Version

v25.0.0

OS version

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions