Skip to main content
Nintex Community Menu Bar
Knowledge Base

SPFx Forms API Access Token using Multi-factor authentication

  • March 28, 2025
  • 0 replies
  • 73 views

Forum|alt.badge.img+9

Topic

The following steps will allow you get a access token for use with the Nintex Forms SPFx API’s when MFA is required.


Instructions 

  1. Obtain theMicrosoft.Identity.Client.dllfrom theNGet package, by extracting it from the downloaded packagelib\<net6.0 or net472>\Microsoft.Identity.Client.dll. 
  1. In the Entra ID app, under theAuthentication, add a newRedirect URIs
  1. Platforms:Mobile and desktop applications 
  1. Custom redirect URIs:http://localhost 
  1. In the same directory of the dll, execute this powershell script: 

 

Add-Type  -Path ".\Microsoft.Identity.Client.dll" 

 

$ClientId = "<Client ID>" 

$TenantId = "<Tenant ID>" 

$RedirectUri = "http://localhost

[string[]] $Scopes = 'https://<tenant>.sharepoint.com/.default' 

 

$App = [Microsoft.Identity.Client.PublicClientApplicationBuilder]::Create($ClientId). 

     WithAuthority("https://login.microsoftonline.com/$TenantId/v2.0"). 

     WithRedirectUri($RedirectUri). 

     Build() 

$Result = $App.AcquireTokenInteractive($Scopes).ExecuteAsync().GetAwaiter().GetResult() 

$Result.AccessToken 


0 replies

Be the first to reply!