Update authorizationPolicy

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Update the properties of a authorizationPolicy object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Policy.ReadWrite.Authorization Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Policy.ReadWrite.Authorization Not available.

Important

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged role is supported for this operation.

  • Privileged Role Administrator

HTTP request

PATCH /policies/authorizationPolicy/authorizationPolicy

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json

Request body

In the request body, supply only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.

The following table specifies the properties that can be updated.

Property Type Description
allowEmailVerifiedUsersToJoinOrganization Boolean Indicates whether a user can join the tenant by email validation.
allowUserConsentForRiskyApps Boolean Indicates whether user consent for risky apps is allowed. Default value is false. We recommend that you keep the value set to false.
allowedToSignUpEmailBasedSubscriptions Boolean Indicates whether users can sign up for email-based subscriptions.
allowedToUseSSPR Boolean Indicates whether administrators of the tenant can use the Self-Service Password Reset (SSPR). For more information, see Self-service password reset for administrators.
blockMsolPowerShell Boolean To disable the use of MSOL PowerShell, set this property to true. This also disables user-based access to the legacy service endpoint used by MSOL PowerShell. This doesn't affect Microsoft Entra Connect or Microsoft Graph.
defaultUserRolePermissions defaultUserRolePermissions Specifies certain customizable permissions for default user role.
description String Description of this policy.
displayName String Display name for this policy.
enabledPreviewFeatures String collection List of features enabled for private preview on the tenant.
guestUserRoleId Guid Represents role templateId for the role that should be granted to guest user. Refer to List unifiedRoleDefinitions to find the list of available role templates. Only supported roles today are User (a0b1b346-4d3e-4e8b-98f8-753987be4970), Guest User (10dae51f-b6af-4016-8d66-8c2a99b929b3), and Restricted Guest User (2af84b1e-32c8-42b7-82bc-daa82404023b).
permissionGrantPolicyIdsAssignedToDefaultUserRole String collection Indicates whether user consent to apps is allowed, and if it is, which app consent policy governs the permission for users to grant consent. Values should be in the format managePermissionGrantsForSelf.{id}, where {id} is the id of a built-in or custom app consent policy. An empty list indicates user consent to apps is disabled.

Response

If successful, this method returns a 204 No Content response code. It doesn't return anything in the response body.

Examples

Example 1: Update or set Guest user access level for the tenant

Request

The following example shows a request. In this example, guest access level is modified to Restricted Guest User.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "guestUserRole":"2af84b1e-32c8-42b7-82bc-daa82404023b"
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Enable new feature for preview on tenant

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "enabledPreviewFeatures":[
      "assignGroupsToRoles"
   ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 3: Block MSOL PowerShell in tenant

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "blockMsolPowerShell":true
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 4: Disable default user role's permission to create applications

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "defaultUserRolePermissions":{
      "allowedToCreateApps":false
   }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 5: Enable default user role to use Self-Serve Password Reset feature

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "allowedToUseSSPR":true
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "permissionGrantPolicyIdsAssignedToDefaultUserRole":[
   
   ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Request

The following example shows a request that allows user consent to apps, subject to the built-in app consent policy microsoft-user-default-low, which allows delegated permissions classified "low", for client apps from verified publishers or registered in the same tenant.

PATCH https://graph.microsoft.com/beta/policies/authorizationPolicy/authorizationPolicy

{
   "permissionGrantPolicyIdsAssignedToDefaultUserRole":[
      "managePermissionGrantsForSelf.microsoft-user-default-low"
   ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content