Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Some features in this article require Microsoft SharePoint Premium - SharePoint Advanced Management
With Microsoft Entra authentication context, you can enforce more stringent access conditions when users access SharePoint sites.
You can use authentication contexts to connect an Microsoft Entra Conditional Access policy to a SharePoint site. Policies can be applied directly to the site or via a sensitivity label.
This capability can't be applied to the root site in SharePoint (for example, https://contoso.sharepoint.com).
Using authentication context with SharePoint sites requires one of the following licenses:
Some apps don't work with authentication contexts. We recommend testing apps on a site with authentication context enabled before broadly deploying this feature.
The following apps and scenarios don't work with authentication contexts:
Setting up an authentication context for labeled sites requires these basic steps:
Add an authentication context in Microsoft Entra ID.
Create a conditional access policy that applies to that authentication context and has the conditions and access controls that you want to use.
Do one of the following:
In this article, we look at the example of requiring guests to agree to a terms of use before gaining access to a sensitive SharePoint site. You can also use any of the other conditional access conditions and access controls that you might need for your organization.
First, add an authentication context in Microsoft Entra ID.
To add an authentication context:
In Microsoft Entra Conditional Access, under Manage, select Authentication context.
Select New authentication context.
Type a name and description and select the Publish to apps check box.
Select Save.
Next, create a conditional access policy that applies to that authentication context and that requires guests to agree to terms of use as a condition of access.
To create a conditional access policy:
In Microsoft Entra Conditional Access, select New policy.
Type a name for the policy.
On the Users and groups tab, choose the Select users and groups option, and then select the Guest or external users check box.
Choose B2B collaboration guest users from the dropdown.
On the Cloud apps or actions tab, under Select what this policy applies to, choose Authentication context, and select the check box for the authentication context that you created.
On the Grant tab, select the check box for the terms of use that you want to use, and then select Select.
Choose if you want to enable the policy, and then select Create.
You can directly apply an authentication context to a SharePoint site by using the Set-SPOSite PowerShell cmdlet.
Note
This capability requires a Microsoft 365 E5 or Microsoft SharePoint Premium - SharePoint Advanced Management license.
In the following example, we apply the authentication context we created above to a site called "research."
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/research -ConditionalAccessPolicy AuthenticationContext -AuthenticationContextName "Sensitive information - guest terms of use"
If you want to use a sensitivity label to apply the authentication context, update a sensitivity label (or create a new one) to use the authentication context.
Note
Sensitivity labels require Microsoft 365 E5 or Microsoft 365 E3 plus the Advanced Compliance license.
To update a sensitivity label
In the Microsoft Purview compliance portal, on the Information protection tab, select the label that you want to update and then select Edit label.
Select Next until you are on the Define protection settings for groups and sites page.
Ensure that the External sharing and Conditional Access settings check box is selected, and then select Next.
On the Define external sharing and device access settings page, select the Use Microsoft Entra Conditional Access to protect labeled SharePoint sites check box.
Select the Choose an existing authentication context option.
In the dropdown list, choose the authentication context that you want to use.
Select Next until you are on the Review your settings and finish page, and then select Save label.
Once the label has been updated, guests accessing a SharePoint site (or the Files tab in a team) with that label will be required to agree to the terms of use before gaining access to that site.
If authentication context is set on a site, admins can choose to prevent background apps from accessing that site for the apps assigned with that authentication context in a conditional access policy. You can configure a conditional access policy such that a specific authentication context can be assigned to chosen application principles (non-Microsoft applications). You need to explicitly turn on this feature via the following cmdlet. You should have at least one conditional access policy with an application principle configured.
Set-SPOTenant -BlockAppAccessWithAuthenticationContext $false/$true (default false)
Third party apps using sites with authentication context attached will need to be able to handle claims challenge. If you have third party apps then we recommend test the apps and you read guidance here.
Conditional Access: Cloud apps, actions, and authentication context
Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn moreTraining
Module
Plan, implement, and administer Conditional Access - Training
Conditional Access gives a fine granularity of control over which users can do specific activities, access which resources, and how to ensure data and systems are safe.
Certification
Microsoft Certified: Identity and Access Administrator Associate - Certifications
Demonstrate the features of Microsoft Entra ID to modernize identity solutions, implement hybrid solutions, and implement identity governance.
Documentation
Block download policy for SharePoint sites and OneDrive - SharePoint in Microsoft 365
Learn how administrators can block download of files from a SharePoint and OneDrive without using conditional access policies.
IT Admins - SharePoint and OneDrive unmanaged device access controls - SharePoint in Microsoft 365
Learn how administrators can block or limit access to SharePoint and OneDrive content on devices that aren't compliant or joined to a domain.
Network location-based access to SharePoint and OneDrive - SharePoint in Microsoft 365
In this article, you'll learn how to control access to SharePoint and OneDrive data based on network location.