Search Results for

    Show / Hide Table of Contents

    PnP Core SDK - Blazor Sample

    This solution demonstrates how the PnP Core SDK can be used in a Blazor WebAssembly app

    Source code

    You can find the sample source code here: /samples/Demo.Blazor

    Run the sample

    Register and configure an AAD app

    In order for the user to authenticate on the App, A new app registration should be created on Azure Portal

    • Go to Azure Active Directory Portal

    • In App registrations, click New registration

    • Enter a name for your new app, make sure Accounts in this organizational directory only is selected. As the Redirect URI, in Web platform enter https://localhost:44349/authentication/login-callback (The port may vary according to your Visual Studio)

    • Under Implicit grant section, check Access tokens and ID tokens

    • Go to API permissions section , click Add a permission -- Select SharePoint > Delegated permissions > select AllSites.FullControl -- Select Microsoft Graph > Delegated permissions > select email, openid and Sites.FullControl.All

    • Click Grant admin consent for {tenant}

    • From Overview, -- copy the value of Directory (tenant) ID -- copy the value of Application (client) ID

    Configure your application

    • Configure the URL of your SharePoint site as the value of SharePoint:SiteUrl app setting
    • in the file wwwroot/appsettings.json, replace the {app_id} and the {tenant_id} accordingly with the values from above

    Execute

    Hit F5 in Visual studio to execute the Blazor app. When trying to access one of the sections, the applications prompts you for signing in

    preview image of the running app

    Back to top PnP Core SDK
    Generated by DocFX with Material UI
    spacer