<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z000081fIC5CAMOkta Classic EngineSingle Sign-OnAnswered2022-08-31T18:10:19.000Z2022-08-30T17:13:01.000Z2022-10-03T23:50:05.000Z

EJS.33436 (Customer) asked a question.

How can I get the public metadata URL for a SAML app using the API?

Hi! I'm trying to use the API to gather SAML metadata urls for several Okta apps. In the past, I've had urls that take the form:

 

https://{oktaDomain}/app/{id}/sso/saml/metadata

 

But it seems the API returns the metadata urls in this form:

 

https://{oktaDomain}/api/v1/apps/{id}/sso/saml/metadata

 

The issue is that the second URL requires that you have a session in place to view the metadata. I have services that are getting 403's when trying to gather the metadata because they don't have a session. I can also verify this by trying to access the second url in an incognito browser, and I receive

"errorCode": "E0000005"

"errorSummary": "Invalid session"

 

I'm trying to use the API to gather metadata urls for several apps without going into the Admin UI. Simply replacing the id from the new URL into the old URL doesn't work and results in a 404 resource not found.

 

Is there a way I can get the public URL via the API?

Is there a way I can get the ID that I need to construct the public URL? I wasn't able to find it in the API response for the application.


  • flaviu.vrinceanu1.5628408972654734E12 (Customer Success Service Delivery)

    Hi @EJS.33436 (Customer)​,

     

    Thank you for posting on the Okta community page!

     

    I have done some research and in order to retrieve the metadata from an Okta SAML app you can use the Preview SAML metadata API call as explained in the documentation provided bellow:

     

    Additionally, in order to get the application ID, you can access the app profile in Okta and retrieve it from the URL.

     

    Also, I have tried as well to access the second link and I receive the same error message, therefore I assume that this would be expected behaviour due to security reasons.

     

    I hope the above information is useful!

    Expand Post
This question is closed.
Loading
How can I get the public metadata URL for a SAML app using the API?