okta / okta-sdk-golang

A Golang SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
https://github.com/okta/okta-sdk-golang
Other
174 stars 143 forks source link

Error unmarshalling Saml11Application in v5 #481

Closed ArikWiz closed 3 weeks ago

ArikWiz commented 1 month ago

Describe the bug?

When unmarshalling okta apps in the ListApplications API, i get the following error:

Failed to unmarshal ListApplications200ResponseInner as Saml11Application: json: cannot unmarshal bool into Go struct field Saml11ApplicationWithoutEmbeddedStruct.settings of type string

i think it's because of this unexpected field:

"manualProvisioning":false

unlike the other fields, it does not appear in:

type Saml11ApplicationSettings struct {
    IdentityStoreId *string `json:"identityStoreId,omitempty"`
    ImplicitAssignment *bool `json:"implicitAssignment,omitempty"`
    InlineHookId *string `json:"inlineHookId,omitempty"`
    Notes *ApplicationSettingsNotes `json:"notes,omitempty"`
    Notifications *ApplicationSettingsNotifications `json:"notifications,omitempty"`
    App *map[string]string `json:"app,omitempty"`
    SignOn *Saml11ApplicationSettingsSignOn `json:"signOn,omitempty"`
    AdditionalProperties map[string]interface{}
}

in the file: github.com/okta/okta-sdk-golang/v5@v5.0.0/okta/model_saml11_application_settings.go

What is expected to happen?

expected to successfully unmarshal the response

What is the actual behavior?

the above mentioned error

Reproduction Steps?

call "ListApplications" in an okta tenant that contains an saml1.1 app. For example "Microsoft Office 365"

Additional Information?

No response

Golang Version

go version go1.22.4 darwin/amd64

SDK Version

5.0.0

OS version

No response

yarivashkenazy commented 1 month ago

Hey, any ETA on this 🙏 ?

duytiennguyen-okta commented 1 month ago

@ArikWiz do you have the response the server?

duytiennguyen-okta commented 1 month ago

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-756114

ArikWiz commented 1 month ago

this is an example of the "settings" of an office 365 app

{
  "app": {
    "tenantType": null,
    "wsFedConfigureType": "MANUAL",
    "occSettings": null,
    "windowsTransportEnabled": false,
    "domain": "somedomain.com",
    "msftTenant": "somethinggmail",
    "domains": [],
    "requireAdminConsent": true
  },
  "notifications": {
    "vpn": {
      "network": {
        "connection": "DISABLED"
      },
      "message": null,
      "helpUrl": null
    }
  },
  "manualProvisioning": false,
  "implicitAssignment": false,
  "notes": {
    "admin": null,
    "enduser": null
  },
  "signOn": {
    "defaultRelayState": null,
    "ssoAcsUrlOverride": null,
    "audienceOverride": null,
    "recipientOverride": null
  }
}

if "ManualProvisioning" is added to Saml11ApplicationSettings (in okta/model_saml11_application_settings.go) and App map[string]string is changed to App map[string]any the unmarshal will work

thank you @duytiennguyen-okta