Closed fra86435 closed 1 day ago
@fra86435 : we removed the multi-tenant "PnP PowerShell management shell" app from Azure AD (Entra) and seems you're using the default app when connecting with PnP Core SDK. Please follow the instructions in https://github.com/pnp/powershell/discussions/4249 to register your own application in Azure AD and use that to connect with PnP Core SDK code. You'll have to provide the id for the created app (clientid), see https://pnp.github.io/pnpcore/tutorials/console/minimalconsole.html for how to that.
Hi, I followed your link https://pnp.github.io/pnpcore/tutorials/console/minimalconsole.html but I continue to receive the same error: AADSTS700016: Application with identifier '31359c7f-bd7e-475c-86db-fdb8c937548e' was not found in the directory 'Contoso'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
I created a new application .net6 c# like the example and the error is the same, I executed all and only the steps in guide https://pnp.github.io/pnpcore/tutorials/console/minimalconsole.html
@fra86435 : just to confirm, you used another application, so you did specify 31359c7f-bd7e-475c-86db-fdb8c937548e as client id?
As client ID I used the ID of the new Application Registration. There is not application or something else with ID 31359c7f-bd7e-475c-86db-fdb8c937548e on my azure subscription. I suspect that this ID is of the old authentication method.
Hi, in these file src/sdk/PnP.Core.Auth/AuthGlobals.cs I found this: internal const string DefaultClientId = "31359c7f-bd7e-475c-86db-fdb8c937548e";
Is possible that this is the cause of the problem?
Hi, I changed the code changing the constructor used for instantiate InteractiveAuthenticationProvider. In the guide https://pnp.github.io/pnpcore/tutorials/console/minimalconsole.html is: options.DefaultAuthenticationProvider = new InteractiveAuthenticationProvider() { ClientId = clientId, RedirectUri = new Uri("http://localhost") };
I changed to options.DefaultAuthenticationProvider = new InteractiveAuthenticationProvider(clientId, tenantId, new Uri("http://localhost")); and it works!
Please update the guide :) Thank you for the support!
I've just removed all references for the Management Shell app, so with tomorrow's build the sample should work again (but I'll test to be sure). Thanks for raising this. I'll close the issue now as you're unblocked.
Category
Describe the bug
Hi, I write here to search an help about this problem. I've a c# console application that use PnP Core to connect to SharePoint Online. From 9 september the authentication fails with message "AADSTS700016: Application with identifier '31359c7f-bd7e-475c-86db-fdb8c937548e' was not found in the directory". I searched online one solution but I found only solutions for PnP Powershell. My code is the same of the example in the guide https://pnp.github.io/pnpcore/using-the-sdk/readme.html (I updated the package reference today)
Thank you, Fra
Steps to reproduce
Create a console application and follow the login guide https://pnp.github.io/pnpcore/using-the-sdk/readme.html
Expected behavior
Login withour errors
Additional context
Error: AADSTS700016: Application with identifier '31359c7f-bd7e-475c-86db-fdb8c937548e' was not found in the directory 'Tecnologie D'Impresa srl'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant. Troubleshooting details If you contact your administrator, send this info to them. Copy info to clipboard Request Id: 72b11044-7e2d-42b6-80fb-92a406563a00 Correlation Id: 7b34c02b-cd81-4b6f-b28c-8a99054c9643 Timestamp: 2024-09-16T12:45:38Z