Skip to content

verify_factor() raises ValidationError on push challenge response due to incorrect profile field types #539

@lboynton

Description

@lboynton

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
    Before submitting a bug report, we ask that you first search existing issues and pull requests to see if someone else may have experienced the same issue or may have already submitted a fix for it.

Python Version & Okta SDK Version(s)

Python v3.14
okta 3.4.2

Affected Class/Method(s)

Method Path Failing response type
verify_factor() POST /api/v1/users/{userId}/factors/{factorId}/verify UserFactorVerifyResponse (200), UserFactorVerifyResponseWaiting (201)

Customer Information

Organization Name:
Paid Customer: no

Code Snippet

client = OktaClient({"orgUrl": "https://example.okta.com", "token": "..."})
result, resp, err = await client.verify_factor(user_id, push_factor_id)

Debug Output / Traceback

pydantic_core._pydantic_core.ValidationError: 6 validation errors for UserFactorVerifyResponseWaiting
profile.credentialId
  Input should be a valid dictionary [type=dict_type, input_value='user@example.com', input_type=str]
profile.deviceType
  Input should be a valid dictionary [type=dict_type, input_value='SmartPhone_Android', input_type=str]
profile.name
  Input should be a valid dictionary [type=dict_type, input_value='My Phone', input_type=str]
profile.platform
  Input should be a valid dictionary [type=dict_type, input_value='ANDROID', input_type=str]
profile.version
  Input should be a valid dictionary [type=dict_type, input_value='14:2024-07-01', input_type=str]
profile.keys
  Input should be a valid dictionary [type=dict_type, input_value=[{...}], input_type=list]

Expected Behavior

Returns a UserFactorVerifyResponse or UserFactorVerifyResponseWaiting containing the poll link for checking the challenge status.

Actual Behavior

Raises ValidationError during deserialisation. The push notification is still delivered to the user's device, but the caller never receives the response:

Steps to reproduce

  1. Ensure the target user has Okta Verify push factor enrolled on a mobile device.
  2. Call verify_factor() to initiate a push challenge:
client = OktaClient({"orgUrl": "https://example.okta.com", "token": "..."})
result, resp, err = await client.verify_factor(user_id, push_factor_id)

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions