Skip to content

list_applications produces pydantic validation errors for SamlApplication #546

@jay-bloodworth

Description

@jay-bloodworth

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.4
okta 3.4.3

Affected Class/Method(s)

okta.api.application_api.ApplicationApi.list_applications
okta.models.saml_application_settings_sign_on.SamlApplicationSettingsSignOn

Customer Information

Organization Name: Health Catalyst
Paid Customer: yes

Code Snippet

import asyncio
from okta.client import Client as OktaClient
import traceback

BASE_URL = "xxx"
CLIENTID = "xxx"
PRIVATE_KEY = "xxx"

async def main():
    config = {
        "authorizationMode": "PrivateKey",
        "orgUrl": f'https://{BASE_URL}',
        "scopes": ["okta.groups.read", "okta.apps.read"],
        "clientId": CLIENTID,
        "privateKey": PRIVATE_KEY
    }
    client = OktaClient(config)
    try:
        data, response, error = await client.list_applications()
        for app in data:
            print(app.label, f'({app.name})', app.id)
    except Exception as e:
        print(f"An error occurred: {e}")
        traceback.print_exc()

if __name__ == "__main__":
    asyncio.run(main())

Debug Output / Traceback

https://gist.github.com/jay-bloodworth/73399b55ccf4bc0ef88052583afe65f7

Expected Behavior

The function should return a list of application objects.

Actual Behavior

The call produced validation errors for the SamlApplication object as shown in the linked gist. In particular, the library complains about the following missing fields:

  • allowMultipleAcsEndpoints
  • assertionSigned
  • honorForceAuthn
  • requestCompressed
  • responseSigned

Steps to reproduce

  1. Run the code snippet provided above with appropriate credentials.

References

This appears to be essentially the same issue as #536 except it involves the fields that were not made optional in the patch resolving that issue. Marking all five of those fields Optional and giving them a default value of None in saml_application_settings_sign_on.py prevents the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions