| title | Update corsConfiguration_v2 |
|---|---|
| description | Update the properties of a corsConfiguration_v2 object. |
| author | dhruvinrshah |
| ms.localizationpriority | medium |
| ms.subservice | entra-applications |
| doc_type | apiPageType |
| ms.date | 12/19/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update the properties of a corsConfiguration_v2 object.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
PATCH /applications/{applicationObjectId}/onPremisesPublishing/segmentsConfiguration/microsoft.graph.webSegmentConfiguration/applicationSegments/{applicationSegment-id}/corsConfigurations/{corsConfiguration_v2-Id}| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
[!INCLUDE table-intro]
| Property | Type | Description |
|---|---|---|
| allowedHeaders | String Collection | The request headers that the origin domain may specify on the CORS request. The wildcard character * indicates that any header beginning with the specified prefix is allowed. |
| allowedMethods | String Collection | The HTTP request methods that the origin domain may use for a CORS request. |
| allowedOrigins | String Collection | The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request originates. The origin must be an exact case-sensitive match with the origin that the user agent sends to the service. |
| maxAgeInSeconds | Integer | The maximum amount of time that a browser should cache the response to the preflight OPTIONS request. |
| resource | String | Resource within the application segment for which CORS permissions are granted. / grants permission for the whole app segment. |
If successful, this method returns a 200 OK response code and an updated corsConfiguration_v2 object in the response body.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/applications/{applicationObjectId}/onPremisesPublishing/segmentsConfiguration/microsoft.graph.webSegmentConfiguration/applicationSegments/{segmentid}/corsConfigurations/{id}
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.corsConfiguration_v2",
"resource": "/",
"allowedOrigins": [
""
],
"allowedHeaders": [
""
],
"allowedMethods": [
""
],
"maxAgeInSeconds": 3000
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 204 No Content