Skip to content

list_applications produces pydantic validation errors for SamlApplication #546

Closed
cartography-cncf/cartography
#1243

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.

Activity

  1. jackvaughanjr commented on Aug 4, 2026

    @jackvaughanjr

    Corroborating this independently against the current pinned release:
    okta==3.4.4, Python 3.13.9, pydantic==2.11.5.

    PR #542 (merged, closing #536) left exactly these 5 fields required in
    okta/models/saml_application_settings_sign_on.py, matching the list above:

    allow_multiple_acs_endpoints: StrictBool = Field(..., alias="allowMultipleAcsEndpoints")
    assertion_signed: StrictBool = Field(..., alias="assertionSigned")
    honor_force_authn: StrictBool = Field(..., alias="honorForceAuthn")
    request_compressed: StrictBool = Field(..., alias="requestCompressed")
    response_signed: StrictBool = Field(..., alias="responseSigned")

    All 10 other fields #542 touched (audience, authnContextClassRef, destination,
    digestAlgorithm, idpIssuer, recipient, signatureAlgorithm, ssoAcsUrl,
    subjectNameIdFormat, subjectNameIdTemplate) are confirmed Optional with
    default=None in the installed 3.4.4 package, so that part of the fix is working as
    intended. This is specifically about the 5 booleans #542 deliberately left
    required.

    Minimal repro isolating the model, with no live tenant needed, captured verbatim
    from a real run:

    from okta.models.saml_application_settings_sign_on import SamlApplicationSettingsSignOn
    SamlApplicationSettingsSignOn.from_dict({})
    5 validation errors for SamlApplicationSettingsSignOn
    allowMultipleAcsEndpoints
      Input should be a valid boolean [type=bool_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.11/v/bool_type
    assertionSigned
      Input should be a valid boolean [type=bool_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.11/v/bool_type
    honorForceAuthn
      Input should be a valid boolean [type=bool_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.11/v/bool_type
    requestCompressed
      Input should be a valid boolean [type=bool_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.11/v/bool_type
    responseSigned
      Input should be a valid boolean [type=bool_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.11/v/bool_type
    

    Exactly the 5 fields listed in the issue description above, with no additional
    drift beyond what has already been identified here.

    #542 already established the fix shape for this: edit openapi/api.yaml's
    required: list for the schema and mirror it in the generated model. The enum
    field_validator guard that pattern sometimes needs doesn't apply here, since
    these 5 are plain booleans with no enum validation. That makes this a
    same-shaped, low-risk follow-up to #542.

    Cross-reference: #572 reports the same class of defect for UserTypeCondition, where an SDK model is stricter than the live API and one non-conforming record aborts an entire page of results.

  2. jasonhernandez commented on Aug 20, 2026

    @jasonhernandez

    Confirming this against another tenant on 3.4.4, and adding a root cause that I think changes how the fix should be scoped.

    The failures track OIN catalog apps vs. custom apps — not partial configuration, which was the framing in #536 and is probably why #542 left these five fields required.

    Measured over a production tenant, filter=signOnMode eq "SAML_2_0", feeding each app individually into ApplicationJsonConverter.from_dict (50 apps, 39 failures, 33 of them these booleans):

    The 33 are all Okta Integration Network catalog integrations — salesforce, slack, google, amazon_aws_sso, plus 25 other catalog templates. Their settings.signOn contains only the override shape:

    attributeStatements, audienceOverride, defaultRelayState,
    destinationOverride, recipientOverride, ssoAcsUrlOverride   [, honorForceAuthn]
    

    For catalog apps the SAML mechanics live in the OIN template rather than the app instance, so the API never returns allowMultipleAcsEndpoints, assertionSigned, requestCompressed, or responseSigned. Every app in the tenant carrying the full custom-SAML signOn shape (23 keys) validated fine.

    Two consequences worth noting:

    1. Any tenant using OIN SAML integrations is affected, which is effectively every production tenant. This is not an edge case reachable only through unusual configuration.
    2. honorForceAuthn varies by template — 9 of the 33 omit it as well, the other 24 include it. So the omitted set is not fixed, which argues for making all five Optional with None defaults rather than relaxing them selectively or special-casing templates.

    On impact: because api_client.py::__deserialize validates an entire page in one list comprehension, those 33 failures make list_applications return None for all 50 apps, of every sign-on mode. There is no per-item tolerance, so a caller cannot skip the offending apps — 11 perfectly valid apps in this tenant are unreachable because of the other 39.

    One caveat for anyone tracking this as their only blocker: fixing these five booleans was not sufficient in my case. 6 further apps in the same tenant fail for two unrelated model defects — Application.features rejecting AUTO_CONFIRM_IMPORTS, and BrowserPluginApplication.name rejecting OIN catalog SWA apps — which I filed separately as #574. Since one failure blanks the page, those 6 keep list_applications returning None even after this issue is resolved.

  3. BinoyOza-okta commented on Sep 21, 2026

    @BinoyOza-okta
    Contributor

    The issue has been addressed and fixed under version v3.4.6. Hence, marking this issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions