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
177 stars 143 forks source link

PreviewSAMLmetadataForApplication of ApplicationSSOAPIService always return error in v4.0.0 #446

Closed SergiiShapoval closed 4 months ago

SergiiShapoval commented 6 months ago

Describe the bug?

PreviewSAMLmetadataForApplication needs both "text/xml", "application/json" Accept headers, or server will return

{"errorCode":"E0000019","errorSummary":"Bad request.  Accept and/or Content-Type headers likely do not match supported values.","errorLink":"E0000019","errorId":"<id>","errorCauses":[]}

but because of selectHeaderAccept client always set only application/json https://github.com/okta/okta-sdk-golang/blob/v4.0.0/okta/api_application_sso.go#L127-L130

What is expected to happen?

Expect metadata retrieved correctly

What is the actual behavior?

always fail with

{"errorCode":"E0000019","errorSummary":"Bad request.  Accept and/or Content-Type headers likely do not match supported values.","errorLink":"E0000019","errorId":"oaeLG2wripTQOeBuWpGjLhhrA","errorCauses":[]}

Reproduction Steps?

create a SAML app using SDK, and then try to fetch metadata for that SAML app

Additional Information?

worked before in v2.20.0

Golang Version

1.22.0

SDK Version

v4.0.0

OS version

No response

duytiennguyen-okta commented 6 months ago

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

duytiennguyen-okta commented 6 months ago

@SergiiShapoval so this happened because the header accept need to be both "text/xml", "application/json" right? or just "text/xml" ?

SergiiShapoval commented 6 months ago

@SergiiShapoval so this happened because the header accept need to be both "text/xml", "application/json" right? or just "text/xml" ?

@duytiennguyen-okta , IMO, if there will be both, it still will work

github-actions[bot] commented 5 months ago

This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale label.

SergiiShapoval commented 5 months ago

This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale label.

@duytiennguyen-okta , still actual

duytiennguyen-okta commented 5 months ago

Not stale

github-actions[bot] commented 5 months ago

This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale label.