SharePoint Development involves creating custom solutions, web parts, and extensions for Microsoft SharePoint. Developers use tools like SharePoint Framework (SPFx) to enhance SharePoint sites and tailor them to specific business needs.
SharePoint development offers benefits such as improved collaboration, document management, workflow automation, and integration with other Microsoft 365 services.
Power Platform Development focuses on building low-code/no-code solutions using Power Apps, Power Automate (formerly Flow), and Power BI. It empowers users to create custom apps, automate processes, and analyse data.
SharePoint and Power Platform can be seamlessly integrated. For example, you can embed Power Apps within SharePoint pages or trigger Power Automate flows based on SharePoint events.
SPFx allows developers to create modern, client-side web parts and extensions for SharePoint. It leverages popular technologies like React and TypeScript.
You can use SPFx to create custom list forms, add custom columns, and apply conditional formatting to lists and libraries.
Power Apps are low-code apps that can be embedded in SharePoint. They allow users to build custom forms, automate processes, and connect to external data sources.
Power Automate (formerly Flow) lets you create automated workflows triggered by SharePoint events. For example, you can automate approval processes or document routing.
Power BI is a powerful business intelligence tool. You can embed Power BI reports and dashboards directly into SharePoint pages for data visualisation.
Implement role-based access control, data loss prevention policies, and adhere to compliance standards. Regularly review permissions and audit logs.
Ensuring security in SharePoint Framework (SPFx) solutions is crucial to protect your organisation’s data and maintain a robust development environment. Let’s explore some best practices:
Stay Updated with SPFx Versions:
Dependency Management:
npm install --save
to save them as dependencies. This ensures consistent versions across environments.package-lock.json
file to lock down dependency versions. Avoid relying on auto-generated lock files.Content Delivery Networks (CDNs):
Office UI Fabric and Fabric React:
Permissions and Authentication:
Secure API Calls:
Sensitive Data Handling:
Code Reviews and Static Analysis:
Deployment Practices:
Logging and Monitoring:
Securing custom APIs used in SharePoint Framework (SPFx) solutions is essential to protect your data and maintain a trustworthy environment. Let’s explore some best practices for achieving this:
Use Azure Active Directory (Azure AD) Authentication:
AAD-Protect Your API: Ensure your custom API is protected by Azure AD. Register an application in Azure AD that represents your API.
OAuth Flow: Configure your API to support both Azure AD and your existing authentication method. SPFx components will use the OAuth implicit flow to authenticate.
Define Permissions in Your Solution Manifest:
In your SPFx solution, list the specific resources (API endpoints) that your solution needs access to. Specify the required permission scopes in your solution manifest.
When deploying the solution package to the app catalog, SharePoint will create permission requests based on your manifest.
Administrator Approval for Permissions:
SharePoint administrators (global or site-level) manage permissions. They can grant or deny specific permissions requested by your solution.
Permissions are granted at the tenant level, not to a specific application. When approved, they apply to all instances of your solution.
Leverage the AadHttpClient:
The AadHttpClient is part of the SharePoint Framework (introduced in v1.4.1). It simplifies connecting to APIs secured by Azure AD.
You don’t need to implement the OAuth flow manually; AadHttpClient handles it for you.
Secure Your Azure Function (or Custom API):
If your custom API is an Azure Function, enable authentication/authorization via Azure AD.
Verify that your Azure Function works when called from a browser.
Logging and Monitoring:
Implement logging within your custom API to track potential security incidents.
Monitor logs for suspicious activity or unexpected behavior.
Handling token expiration in SharePoint Framework (SPFx) solutions is crucial to ensure uninterrupted access to secured services. Let’s explore some strategies for managing token expiration:
OAuth Implicit Flow:
SPFx relies on the OAuth implicit flow to acquire access tokens. In this flow, tokens are obtained directly in the browser without using a client secret.
When a token expires, SPFx components automatically request a new one using silent single sign-on (SSO) via a hidden <iframe>. However, there are scenarios where this silent SSO might fail (e.g., due to browser settings or third-party cookie blocking).
AADTokenProvider:
The AADTokenProvider API in SPFx allows developers to obtain OAuth tokens from Azure AD. These tokens authenticate users to services like Microsoft Graph, Power BI, and more.
When silent SSO fails, SPFx can fall back to a full page redirect or a popup flow experience to prompt users for sign-in.
Popup Flow Experience:
To enable the popup experience, a tenant administrator must first activate the feature at the tenant level using the Set-SPOTenant command with the -IsEnableAppAuthPopupEnabled argument.
When SPFx components encounter token expiration, they trigger a popup window for user authentication instead of a full page redirect.
Your component can handle the AADTokenProvider.popupEvent to customize the popup flow. For example:
TypeScript
const configurableTokenProvider: AadTokenProvider = _AadTokenProviders.configurable as AadTokenProvider;
configurableTokenProvider.popupEvent.add(this, (args: IPopupEventArgs) => {
args.cancel(); // Cancel the default popup
args.showPopup(); // Initiate the custom popup flow
});
User Interaction Requirement:
Note that browsers often block popups unless initiated by a user action (e.g., button click). Ensure your component initiates the popup flow appropriately.
Certainly! Securing custom APIs used by SharePoint Framework (SPFx) components is essential to protect your data and ensure a trustworthy integration. Let’s dive into the details:
Azure Active Directory (Azure AD) Integration:
AadHttpClient
, which simplifies connecting to APIs secured by Azure AD. You don’t need to manually implement the OAuth flow—it’s handled for you.Web API Permissions Overview:
SPFx Integration with Azure AD:
MSGraphClient
and AadHttpClient
.MSGraphClient
: Used for accessing Microsoft Graph resources.AadHttpClient
: Used for connecting to custom APIs secured by Azure AD.Permissions Are Tenant-Wide:
Earlier Versions of SPFx:
Best Practices:
Certainly! Securing SharePoint list data accessed by web parts is crucial to protect sensitive information and ensure proper access control. Let’s explore some best practices for achieving this:
Row-Level Security in SharePoint Lists:
Web Part Security:
Collaborative Effort:
Certainly! Securing SharePoint document libraries is crucial to protect sensitive information and maintain data integrity. Whether you’re storing confidential files, intellectual property, or critical documents, here are some best practices to build a super secure document library in SharePoint:
Implement the 10 Steps to Secure a Site:
Before focusing on the document library, start with the site itself. Follow comprehensive security practices for the entire site. If you haven’t already, review my guide on how to secure a SharePoint site. These steps lay the foundation for a secure environment.Add Only Necessary Users and Groups:
Disable Sharing:
Disable Offline Sync:
Prevent File Deletion:
Set Up Alerts:
Certainly! When it comes to securing SharePoint document libraries and managing permissions, there are some common pitfalls to watch out for. Let’s explore these, along with best practices to avoid them:
Inadequate User Permissions Settings:
Lack of Regular Audits and Reviews:
Inconsistent or Lax Security Policies:
Deep-Assigned Permissions:
Data Loss During Local Sync:
Overreliance on Admins:
Unclear File Storage Locations:
Certainly! Managing permissions in SharePoint is crucial for maintaining security, controlling access, and ensuring efficient collaboration. Let’s explore some best practices to help you effectively manage permissions:
Apply Security at the Site Level:
Use Built-In Security Groups:
Regularly Review and Audit Permissions:
Grant the Least Permissions Possible:
Manage Inheritance of Permissions:
Educate Users on Permissions Management: