microsoft / Dynamics-AX-Integration

Dynamics AX Integration samples and demos.
287 stars 356 forks source link

No P3P policy defined #41

Closed RobvanB closed 6 years ago

RobvanB commented 6 years ago

Getting this error: CP=\"No P3P policy defined. Read the Microsoft privacy statement at https://go.microsoft.com/fwlink/?LinkId=271135\""

Any idea what this means, and how to fix it ?

srpraveenkumar commented 6 years ago

Most common reason for this error is authentication failure.

You will see details on how to register for a client here. https://github.com/Microsoft/Recurring-Integrations-Scheduler/wiki#registering-an-application-in-azure-active-directory

CorneCasper commented 5 years ago

I am currently integrating a 3rd party application with Dynamics D365 using Odata. I did this a few months ago and it worked fine. I followed the same procedure this time as well.

I registered the app as a web app in Azure Active Directory. Acquired the Directory ID, App ID, client secret and selected the Microsoft Dynamics ERP API and granted the needed delegated permissions.

I created the service account in D365 F&O. I can acquire a token from https://login.microsoftonline.com/[tenant_id]/oauth2/token and it is successful. But when I try to access the data I am greeted with a 401 Authentication failed.

I checked if TLS versions enabled in the browser and it supports 1.0 , 1.1 & 1.2 I decoded the bearer token at https://jwt.ms/ and all the needed information was inside the token. All permissions in AAD was granted by an administrator and was successful. Tried generating a new client secret and entered it at all the appropriate places. Still authentication failed. Even contacted Microsoft who could not help me.

Like I said, I did this exact same process a few months earlier on a different server and it still works perfectly.

I've looked at the following Microsoft websites and none of them offers any working solutions. https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/services-home-page#register-a-native-application-with-aad https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/third-party-service-test https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#client-credentials-grant-flow-diagram https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens

Any help would be greatly appreciated.

fmagalini commented 5 years ago

Same here. I've found authentication errors trying to call the connector from Azure Data Factory. Not beeing able to understand the issue I've replicated the error with PostMan and with this integration SDK. The AAD token is generated, the JWT is OK, the AAD App is configured in the D365 AAD Applications but I get always a 401. I'm working with a 8.1.2 enviroment. Thanks

smk85 commented 5 years ago

Hi, did anyone find a solution? I have the same problem. I get my Token from https://login.windows.net/tenantdomainname/oauth2/token
and I pass it in a POST http header under Authorization: Bearer tokenGiven And i get a HTTP 400 Bad Request with a No P3P policy defined.

This has been going for a long time now. I tried it in every possible way and I finally came accross this class and eveyrthing made sense and i fell in the same error again.

Anyone can help me please.

ccampora commented 4 years ago

Normally this is caused because the user that is configured in the ADD Integration in D365fO, linked to the APP ID does not have enough permission. To completely avoid this, make sure the user that runs the application has system administrator role.

ppoussane commented 4 years ago

Nothing yet?

DShukvaniProdware commented 4 years ago

Hello, I had the issue when connecting to Azure AD app, and I resolved it by using the same user account email as is on the tenant. When it was failing, my email was user@company.com tenant id was company-core.com after using email: user@company-core.com it worked.

Create an account on tenant which you are using and use that account for all related operations. I found this hint on this correspondence