-
I am looking at way to get user token with userid and password for sharepoint online via c#. I can register as app with clientid and client secret but I am not looking for it. PnP has powershell commend Get-PnPAccessToken and just need same via C#. Is there a way to get it for SharePoint online via c#? Many thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To get an access token you need an app, there's no way around. In PnP PowerShell you might not have created an app but in that case you're reusing an other app like the PnP Management Shell app or the SPO Management Shell app. You'll then get an access token with the permissions defined on the app. I would recommend creating the needed app in Azure AD with the permissions you need and then use that. Register-PnPAzureADApp can help you with setting up that app |
Beta Was this translation helpful? Give feedback.
To get an access token you need an app, there's no way around. In PnP PowerShell you might not have created an app but in that case you're reusing an other app like the PnP Management Shell app or the SPO Management Shell app. You'll then get an access token with the permissions defined on the app. I would recommend creating the needed app in Azure AD with the permissions you need and then use that. Register-PnPAzureADApp can help you with setting up that app