sp-dev-fx-webparts/samples/react-site-secure-function-...
Hugo Bernier 4ac2d2ac38 Updated readme, sample, and container 2024-07-14 22:21:33 -04:00
..
.devcontainer Updated readme, sample, and container 2024-07-14 22:21:33 -04:00
Functions Remove warnings 2024-07-13 10:03:58 +02:00
assets Updated readme, sample, and container 2024-07-14 22:21:33 -04:00
config New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
src Remove warnings 2024-07-13 10:03:58 +02:00
teams New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
.eslintrc.js Remove warnings 2024-07-13 10:03:58 +02:00
.gitignore New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
.npmignore New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
.nvmrc Updated readme, sample, and container 2024-07-14 22:21:33 -04:00
.yo-rc.json New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
README.md Updated readme, sample, and container 2024-07-14 22:21:33 -04:00
gulpfile.js New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
package-lock.json New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
package.json New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00
tsconfig.json New sample react-site-secure-function-call 2024-07-12 13:14:17 +02:00

README.md

Site Secure Function Call

Summary

This combined SharpPoint Framework and Azure Function solution is to provide the potentially most secure access from SharePoint Framework to any kind of third party API, in fact here Microsoft Graph. It shows that AadHttpClient should be preferred over MSGraphClient.

Update site description
Update site description

For further details see the author's blog post

Compatibility

⚠️ Important
Every SPFx version is optimally compatible with specific versions of Node.js. In order to be able to build this sample, you need to ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.
Refer to https://aka.ms/spfx-matrix for more information on SPFx compatibility.

This sample is optimally compatible with the following environment configuration:

SPFx 1.18.2 Node.js v16 | v18 Compatible with SharePoint Online Does not work with SharePoint 2019 Does not work with SharePoint 2016 (Feature Pack 2) Local Workbench Unsupported Hosted Workbench Compatible Compatible with Remote Containers

Applies to

Version history

Version Date Author Comments
1.0 July 12, 2024 Markus Moeller Initial release

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 web 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

Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you're having issues building the solution, please run spfx doctor from within the solution folder to diagnose incompatibility issues with your environment.

You can try looking at issues related to this sample to see if anybody else is having the same issues.

You can also try looking at discussions related to this sample and see what the community is saying.

If you encounter any issues using this sample, create a new issue.

For questions regarding this sample, create a new question.

Finally, if you have an idea for improvement, make a suggestion.

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.