mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-14 00:45:23 +00:00
react-site-secure-function-call
Summary
This combined SharpPoint Framework and Azure Function solution is to provide the potentially most secure access from SharePoint Famework to any kind of third party API, in fact here Microsoft Graph. It shows that AadHttpClient should be preferred over MSGraphClient.
Update site descreption |
---|
![]() |
For further details see the author's blog post
Used SharePoint Framework Version
Applies to
Version history
Version | Date | Author | Comments |
---|---|---|---|
1.0 | July 12, 2024 | Markus Moeller | Initial release |
Disclaimer
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
Minimal Path to Awesome
- Clone this repository
git clone https://github.com/pnp/sp-dev-fx-webparts.git
- You will need to register an app in Entra ID
- with client secret
- with delegated Graph permission Sites.FullControl.All
- With exposed Api "access_as_user" and App ID Uri api://[Your-Desired-Func-Url]/[Your-ClienID]
- Azure Function:
- Rename local.sample.settings.json to local.settings.json and fill out tenantId, clientId, clientSecret and domain [Your-Desired-Func-Url]
- Run F5
- SPFx web part
- Move to wep part folder
cd samples\react-site-secure-function-call
- Rename azFunct.sample.json to azFunct.json and fill out appIdUri api://[Your-Desired-Func-Url]/[Your-ClienID]
- Ensure that you are at the solution folder
- in the command-line run:
- npm install
- gulp serve
Include any additional steps as needed.
Features
Description of the extension that expands upon high-level summary above.
This extension illustrates the following concepts:
References
- Getting started with SharePoint Framework
- Building for Microsoft teams
- Use Microsoft Graph in your solution
- Publish SharePoint Framework applications to the Marketplace
- Microsoft 365 Patterns and Practices - Guidance, tooling, samples and open-source controls for your Microsoft 365 development