Function getSharePointTokenUserAuth

  • get SharePoint token using user authentication

    Parameters

    • ctx: Context
    • props: {
          clientId: string;
          localPort: number;
          resourceUrl?: string;
          scopes: string[];
          tenantId: string;
      }
      • clientId: string

        Client ID

      • localPort: number

        Local port for redirect

      • OptionalresourceUrl?: string

        Optional resource URL to navigate to

      • scopes: string[]

        Scopes for the token

      • tenantId: string

        Tenant ID

    Returns Promise<string>

    SharePoint access token

    const token = await getSharePointTokenUserAuth(ctx, {
    clientId: 'your-client-id',
    tenantId: 'your-tenant-id',
    localPort: 3000,
    scopes: ['https://graph.microsoft.com/.default'],
    resourceUrl: 'https://your-sharepoint-site-url',
    });