Configure CORS

Centrify's authorization server allows for Cross-Origins Resource Sharing (CORS) requests from trusted origins (domains). This page demonstrates the API calls to programmatically get and set the origins for which CORS requests are allowed on a tenant.

Obtaining a List of Trusted Origins

Invoke the /TenantConfig/GetCustomerConfig endpoint to get a list of the origins currently trusted by the tenant for CORS requests:

POST https://tenant.my.centrify.net/TenantConfig/GetCustomerConfig

The AllowCors field in the response lists the origins currently trusted by the tenant for CORS requests:

{  
   "success":true,
   "Result":{  
      "EmailImage":null,
      "SendPasswordChangeConfirmation":false,
      "IsPasswordPersistanceEnabled":false,
      "SmsSystemEnabled":true,
      ...

      "DirectoryServiceInfo":[  
         {  
            "ServiceName":"CDS",
            "Config":{  
               "Uuid":"09B9A9...",
               "tenant":"AAA1234"
            },
            "Name":"CDS",
            "InEverybody":true,
            "Uuid":"09B9A9..."
         },
         ...
      ],
      "Brand":"centrify",
      "Icon":"data:image/png;base64,iVBO7t...dFR5ErkJggg==",
      "DefaultNumberOfTimeChunksInDashboard":7,
      "AllowCors":[  
         "www.abc.com",
         "acme.my.centrify.net",
         "www.test.com",
         "www.test2.com"
      ],
      "Name":"[email protected]",
      "UserSettings":{  
         "uisection":{  
            "quickStartWizardKey":{  
               "WEB_APP_ADDED_KEY":false,
               "INVITES_SENT_KEY":false,
               "MOBILE_APP_ADDED_KEY":false,
               "USER_CREATED_KEY":false
            },
            "nav-part-Core-Services-expanded":true,
            "nav-part-Settings-expanded":true,
            "doNotShowQuickstart":true,
            "defaultdash":"SecurityDash"
         }
      },
      "MobileLocationHistoryTrackingEnabled":false,
      "PhoneCallsEnabled":true,
      "MfaAttributeMapping":{  
         "otherHomePhone":"MobilePhone"
      },
      "InternetGatewayAllowed":true,
      "BackgroundColor":"",
      "ForgotUsernameAllowed":true,
      "Uuid":"bb583c...",
      "EnableTenantsTabForPeopleWithTaskCheck":false,
      "EnableUmc":false
   },
   "Message":null,
   ...
}

Setting the Trusted URIs for CORS Requests

To update the trusted origins for CORS requests allowed on the tenant, first get the current list of URIs by invoking the /TenantConfig/GetCustomerConfig endpoint as demonstrated above and then extract the origins from the AllowCors field.

Update the list of origins as required and then invoke the /TenantConfig/SetCustomerConfig endpoint passing the list via the AllowCors field:

POST https://tenant.my.centrify.net/TenantConfig/SetCustomerConfig

{  
   "IsPasswordPersistanceEnabled":false,
   "ForgotUsernameAllowed":true,
   "SendPasswordChangeConfirmation":false,
   "MfaAttributeMapping":{  

   },
   "AllowCors":[  
      "www.abc.com",
      "www.test.com",
      "www.test2.com",
      "www.test3.com"
   ],
   "Domain":""
}

The success field in the response indicates if the request was successful:

{  
   "success":true,
   "Result":null,
   "Message":null,
   "MessageID":null,
   "Exception":null,
   "ErrorID":null,
   "ErrorCode":null,
   "InnerExceptions":null
}