class CrossTenantAccessPolicy
Represents the base policy in the directory for cross-tenant access settings in Microsoft 365/Azure AD environments.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/policies/cross_tenant_access.py
5 - 15
moderate
Purpose
This class manages cross-tenant access policies that control collaboration between different Microsoft cloud tenants. It extends PolicyBase to provide specific functionality for configuring which Microsoft cloud endpoints an organization can collaborate with, enabling secure cross-tenant access scenarios in multi-cloud Microsoft environments.
Source Code
class CrossTenantAccessPolicy(PolicyBase):
"""Represents the base policy in the directory for cross-tenant access settings."""
@property
def allowed_cloud_endpoints(self):
"""
Used to specify which Microsoft clouds an organization would like to collaborate with. By default, this value
is empty. Supported values for this field are: microsoftonline.com, microsoftonline.us,
and partner.microsoftonline.cn.
"""
return self.properties.get("allowedCloudEndpoints", StringCollection())
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
PolicyBase | - |
Parameter Details
__init__: Inherits constructor from PolicyBase. The exact parameters depend on the parent class implementation, but typically includes policy configuration data and connection context for Microsoft Graph API interactions.
Return Value
Instantiation returns a CrossTenantAccessPolicy object that provides access to cross-tenant policy settings. The allowed_cloud_endpoints property returns a StringCollection containing the list of permitted Microsoft cloud endpoints for collaboration.
Class Interface
Methods
@property allowed_cloud_endpoints(self) -> StringCollection
property
Purpose: Retrieves the list of Microsoft cloud endpoints that the organization is allowed to collaborate with for cross-tenant access
Returns: StringCollection containing allowed Microsoft cloud endpoints. Returns empty collection if not configured. Possible values include 'microsoftonline.com', 'microsoftonline.us', and 'partner.microsoftonline.cn'
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
properties |
dict | Inherited from PolicyBase. Dictionary containing the policy configuration data, including the 'allowedCloudEndpoints' key | instance |
Dependencies
office365
Required Imports
from office365.directory.policies.base import PolicyBase
from office365.runtime.types.collections import StringCollection
Usage Example
# Assuming you have an authenticated Office 365 client context
from office365.directory.policies.cross_tenant_access import CrossTenantAccessPolicy
# Instantiate through the Office 365 client (typical usage pattern)
# policy = client.policies.cross_tenant_access_policy.get().execute_query()
# Access allowed cloud endpoints
allowed_endpoints = policy.allowed_cloud_endpoints
for endpoint in allowed_endpoints:
print(f"Allowed endpoint: {endpoint}")
# The property returns endpoints like:
# - microsoftonline.com (commercial cloud)
# - microsoftonline.us (US Government cloud)
# - partner.microsoftonline.cn (China cloud)
Best Practices
- This class is typically instantiated through the Office 365 client context rather than directly, as it requires proper authentication and API connection setup
- The allowed_cloud_endpoints property is read-only and retrieves data from the underlying properties dictionary
- Always ensure proper permissions are granted before attempting to access or modify cross-tenant policies
- The class inherits from PolicyBase, so all base policy methods and properties are available
- Handle cases where allowedCloudEndpoints might not be set in the properties dictionary (returns empty StringCollection by default)
- Supported cloud endpoints are limited to: microsoftonline.com, microsoftonline.us, and partner.microsoftonline.cn
- Changes to cross-tenant policies may require additional API calls to persist, depending on the parent class implementation
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class TenantAppManagementPolicy 71.8% similar
-
class AuthorizationPolicy 70.9% similar
-
class ConditionalAccessPolicy 67.6% similar
-
class PolicyRoot 65.5% similar
-
class PolicyBase 64.1% similar