<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rainson12</title>
    <description>The latest articles on DEV Community by Rainson12 (@rainson12).</description>
    <link>https://dev.to/rainson12</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F459852%2F008a24e7-2cef-42e4-93b5-64c252febe32.png</url>
      <title>DEV Community: Rainson12</title>
      <link>https://dev.to/rainson12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rainson12"/>
    <language>en</language>
    <item>
      <title>SharePoint Framework WebPart &amp; Asp.Net Core WebApi with Azure AD Auth</title>
      <dc:creator>Rainson12</dc:creator>
      <pubDate>Fri, 04 Mar 2022 15:38:59 +0000</pubDate>
      <link>https://dev.to/rainson12/sharepoint-framework-webpart-aspnet-core-webapi-with-azure-ad-auth-5bl7</link>
      <guid>https://dev.to/rainson12/sharepoint-framework-webpart-aspnet-core-webapi-with-azure-ad-auth-5bl7</guid>
      <description>&lt;p&gt;When developing new Webparts for SharePoint or Addins for Office 365 you might want to make use of your own APIs. This will raise the challenge of how to protect you backend and authenticate your users. Since I haven't found any good and complete guidelines on how to setup an SPFX  Webpart together with a C# ASP.Net Core WebApi backend, I wanted to share my approach. &lt;/p&gt;

&lt;p&gt;Setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VS Studio 2019&lt;/li&gt;
&lt;li&gt;VS Code (for SPFX development)&lt;/li&gt;
&lt;li&gt;.Net Core 5&lt;/li&gt;
&lt;li&gt;Azure AD Global Admin or at least &lt;code&gt;Privileged Role Administrator&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en/sharepoint/dev/spfx/set-up-your-development-environment" rel="noopener noreferrer"&gt;SPFX prerequisites (Node v14, Yeoman, generator-sharepoint)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create the Backend
&lt;/h2&gt;

&lt;p&gt;Create a new Project using VS 2019. If you are asked for the project template choose &lt;code&gt;ASP.NET Core Web API&lt;/code&gt;. Click on next when asked for the Target Framework and Authentication Type choose &lt;code&gt;Microsoft identity platform&lt;/code&gt;:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw6hai8odmjryjkcziki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmw6hai8odmjryjkcziki.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
After creation of the project you will be prompted for an additional required package called &lt;code&gt;dotnet msidentity tool&lt;/code&gt;. Just click &lt;code&gt;finish&lt;/code&gt; to complete the project creation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Configure the Microsoft identity platform
&lt;/h3&gt;

&lt;p&gt;To configure the microsoft identity platform to connect zu your Azure AD click on configure at the connected services screen:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2r4ws2drh7tu8qqirdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2r4ws2drh7tu8qqirdl.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
A Browser Window will open and you are asked to login to your 365 tenant. If you already have an App registered in Azure you can select an existing one, otherwise just let Visual Studio create one for you:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7suoxe6mew18drus90j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7suoxe6mew18drus90j.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
In the opening dialog just enter the application Name which will be created on the Azure AD side.&lt;br&gt;&lt;br&gt;
After creation, select the newly created APP. When asked for Additional Configuration you do not need to select anything. Additional Graph or Permissions to another API can be revisited when going to the App Registrations in the Azure Admin Portal. After finishing the dialog and installing required nuget packages you will see that the &lt;code&gt;Microsoft identity platform&lt;/code&gt; is now configured. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsi27g4gl932jjacq0jm2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsi27g4gl932jjacq0jm2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By configuring the Microsoft identity platform a few things happend with your project. If you check the &lt;code&gt;appsettings.json&lt;/code&gt; you will see that there is a configuration part created for &lt;code&gt;AzureAd&lt;/code&gt; this includes your azure domain, tenant Id and client id. These configuration settings will match the App that has been created on the Azure side. When opening the &lt;code&gt;Startup.cs&lt;/code&gt; you will find that the authentication was added to the service and app configuration:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxe2dx4e54go7giuxj2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxe2dx4e54go7giuxj2b.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
For allowing access from other origins we need to configure CORS. To allow all orgins simply add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.UseCors(x =&amp;gt; x
               .AllowAnyMethod()
               .AllowAnyHeader()
               .AllowCredentials()
               .SetIsOriginAllowed(hostName =&amp;gt; true));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to the &lt;code&gt;Configure(IApplicationBuilder app, IWebHostEnvironment env)&lt;/code&gt; method. Make sure to add the &lt;code&gt;.UseCors&lt;/code&gt; before the &lt;code&gt;.UseEndoints&lt;/code&gt; for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c =&amp;gt; c.SwaggerEndpoint("/swagger/v1/swagger.json", "WebApplication1 v1"));
            }

            app.UseHttpsRedirection();
            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseCors(x =&amp;gt; x
               .AllowAnyMethod()
               .AllowAnyHeader()
               .AllowCredentials()
               .SetIsOriginAllowed(hostName =&amp;gt; true));

            app.UseEndpoints(endpoints =&amp;gt;
            {
                endpoints.MapControllers();
            }); 
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When checking the &lt;code&gt;WeatherForecastController.cs&lt;/code&gt; in the &lt;code&gt;Controllers&lt;/code&gt; directory, ensure that the controller is guarded with an &lt;code&gt;Authorize&lt;/code&gt; annotation:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7x2mf5fqwtq3g3f23ac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7x2mf5fqwtq3g3f23ac.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This annotation will ensure that the endpoints of this controller can only be accessed by Users which are authenticated by your Azure AD. You can run the debugger and try to access your endpoint by accessing &lt;code&gt;https://localhost:44340/WeatherForecast&lt;/code&gt; in your browser (depending on your debug configurations a different port can be used). You should receive an Http 401 Error, this means you are not authorized since your Browser is not passing the Azure AD token to your backend. This is expected, however when setting up the SharePoint Framework Webpart we will configure it, so that the token will be passed from SharePoint Online to your backend without any additional authentication. &lt;/p&gt;
&lt;h2&gt;
  
  
  Create the SharePoint Framework WebPart
&lt;/h2&gt;

&lt;p&gt;In this guide I will make use of the Yeoman generator to generate the boilerplate code to get started. Please not that I will be using the react template and name my application &lt;code&gt;HelloWorld&lt;/code&gt; for this guide. If you are unsure on how to initialize the SPFX Webpart &lt;a href="https://docs.microsoft.com/en/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part" rel="noopener noreferrer"&gt;follow the steps documented by Microsoft&lt;/a&gt;. After creation of the boilerplate open the folder in vscode.&lt;/p&gt;

&lt;p&gt;In order to pass the Azure Token from your signed in user we to the backend you need to make use of &lt;code&gt;AadHttpClientFactory&lt;/code&gt;. The boilerplate code will make it available in the default WebPart class. Since I gave my App the default &lt;code&gt;HelloWorld&lt;/code&gt; name, the root file to bootstrap our application can be found at &lt;code&gt;src\webparts\helloWorld\HelloWorldWebPart.ts&lt;/code&gt;. Open that file and pass the instance of &lt;code&gt;this.context.aadHttpClientFactory&lt;/code&gt; to the generated component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public render(): void {
    const element: React.ReactElement&amp;lt;IHelloWorldProps&amp;gt; = React.createElement(
      HelloWorld,
      {
        aadHttpClientFactory: this.context.aadHttpClientFactory,
        description: this.properties.description,
        isDarkTheme: this._isDarkTheme,
        environmentMessage: this._environmentMessage,
        hasTeamsContext: !!this.context.sdks.microsoftTeams,
        userDisplayName: this.context.pageContext.user.displayName
      }
    );

    ReactDom.render(element, this.domElement);
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since now the type validation will complain, we need to adjust the interface for the props that will be passed to the component. Open the file &lt;code&gt;src\webparts\helloWorld\components\IHelloWorldProps.ts&lt;/code&gt; and add &lt;code&gt;aadHttpClientFactory: AadHttpClientFactory;&lt;/code&gt; to the interface:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { AadHttpClientFactory } from '@microsoft/sp-http';

export interface IHelloWorldProps {
  description: string;
  isDarkTheme: boolean;
  environmentMessage: string;
  hasTeamsContext: boolean;
  userDisplayName: string;
  aadHttpClientFactory: AadHttpClientFactory;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we pass the Factory for creating clients to access our Endpoints we need to make use of it. Open the file &lt;code&gt;src\webparts\helloWorld\components\HelloWorld.tsx&lt;/code&gt;. I replaced the render code to just render a Button which when being clicked will call our backend endpoint. Please note that you need to update the Id used in the &lt;code&gt;getClient()&lt;/code&gt; method. The Id which should be used here is your clientId which you will find in the &lt;code&gt;appsettings.json&lt;/code&gt; from you backend project. In my case this is &lt;code&gt;acc8e92b-a093-4514-a9f8-de4e92301aed&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as React from 'react';
import styles from './HelloWorld.module.scss';
import { IHelloWorldProps } from './IHelloWorldProps';
import { escape } from '@microsoft/sp-lodash-subset';
import { DefaultButton } from 'office-ui-fabric-react';
import { AadHttpClient, HttpClientResponse } from '@microsoft/sp-http';

export default class HelloWorld extends React.Component&amp;lt;IHelloWorldProps, {}&amp;gt; {
  private async callBackend (): Promise&amp;lt;void&amp;gt; {
    let client = await this.props.aadHttpClientFactory.getClient('acc8e92b-a093-4514-a9f8-de4e92301aed');
    let response: HttpClientResponse = await client.get('https://localhost:44340/WeatherForecast', AadHttpClient.configurations.v1);
    let jsonData = await response.json();
    console.log(jsonData);
  }

  public render(): React.ReactElement&amp;lt;IHelloWorldProps&amp;gt; {
    const {
      description,
      isDarkTheme,
      environmentMessage,
      hasTeamsContext,
      userDisplayName
    } = this.props;

    return (
      &amp;lt;section className={`${styles.helloWorld} ${hasTeamsContext ? styles.teams : ''}`}&amp;gt;
        &amp;lt;DefaultButton onClick={this.callBackend.bind(this)}&amp;gt;Click me&amp;lt;/DefaultButton&amp;gt;
      &amp;lt;/section&amp;gt;
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that the code is finished we need to add the required permission which has to be approved by the Admin when adding our WebPart to our SharePoint App Catalog. Therefore you have to open the &lt;code&gt;package-solution.json&lt;/code&gt; and add (make sure to replace the resource id with your client id from above).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"webApiPermissionRequests": [
      {
        "resource": "acc8e92b-a093-4514-a9f8-de4e92301aed",
        "scope": "user_impersonation"
      }
    ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to the solution so it will look like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flipwvmot6eiqn4sb5it0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flipwvmot6eiqn4sb5it0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you now want to run your SPFX Webpart using &lt;code&gt;gulp serve&lt;/code&gt; in your SharePoint Online Workbench we need to grant the Workbench App permissions, this however is not required when packaging and deploying the App without using the workbench. To grant permission to the workbench open your &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;azure portal&lt;/a&gt;. Navigate to &lt;code&gt;App registrations&lt;/code&gt;:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxyaptj7qdn409zyq5fr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxyaptj7qdn409zyq5fr.png" alt="Image description"&gt;&lt;/a&gt;. Select &lt;code&gt;All applications&lt;/code&gt; and search for &lt;code&gt;SharePoint Online Client Extensibility Web Application Principal&lt;/code&gt;. Choose the first one:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmajb6q6x7lp0hhrr6lnw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmajb6q6x7lp0hhrr6lnw.png" alt="Image description"&gt;&lt;/a&gt;. Now we need to add the permission to allow passing the user to our backend. Click on &lt;code&gt;API Permissions&lt;/code&gt; and then &lt;code&gt;Add a permission&lt;/code&gt; and then &lt;code&gt;APIs my organization uses&lt;/code&gt;. Search for your clientId or App Name which you used during the VS Wizard for setting up the microsoft identity platform:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzy6hlgso0mpv9x0wtbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzy6hlgso0mpv9x0wtbq.png" alt="Image description"&gt;&lt;/a&gt;. Select the App and add &lt;code&gt;access_as_user&lt;/code&gt; permission:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mn349r2n993ma6rw20t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mn349r2n993ma6rw20t.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
After adding the permission grant the admin consent to put the added permission effective:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxiimf5sq840pgkfzmpp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxiimf5sq840pgkfzmpp.png" alt="Image description"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you now run &lt;code&gt;gulp server&lt;/code&gt; in your SPFX folder and open your workbench, you should see a button. When clicking it you will have to login (unless you already logged in to your tenant). After authentication you will see the backend response in your console:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwmw1p4nzvrabf3d5yh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwmw1p4nzvrabf3d5yh5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;When deploying the WebPart you need to adjust the appregistration since your URLs will change. In order to do that access your Azure Portal and open the app registration site. Choose again &lt;code&gt;All applications&lt;/code&gt; and search for your application name which you gave during the VS Wizard for the setup of the microsoft identity platform.  You can also filter by clicking on the &lt;code&gt;Application (client) ID starts with&lt;/code&gt; field and paste your clientId which we used previously. You should now find your app:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg0ivw4wa4womp7wjg3r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg0ivw4wa4womp7wjg3r.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Click on it and open the Authentication Panel:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4r9wz1mr25dlnvrfye4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4r9wz1mr25dlnvrfye4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All you have to do now is updating the redirect URLs to the final URLs.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>sharepoint</category>
    </item>
  </channel>
</rss>
