-2

I have set up Dynamics 365 using a Trial subscription with a database. Deployment is set to FieldService Premium Trial.

For querying data from Dataverse I have to use WebAPI but it is failing to authenticate from the postman. I have set up Azure Active directory with the following settings.

enter image description here

And manifest is set up like this:

{
    "acceptMappedClaims": null,
    "accessTokenAcceptedVersion": null,
    "addIns": [],
    "allowPublicClient": true,
    "appRoles": [],
    "oauth2AllowUrlPathMatching": false,
    "createdDateTime": "2022-04-22T11:11:03Z",
    "description": null,
    "certification": null,
    "disabledByMicrosoftStatus": null,
    "groupMembershipClaims": null,
    "identifierUris": [],
    "informationalUrls": {
        "termsOfService": null,
        "support": null,
        "privacy": null,
        "marketing": null
    },
    "keyCredentials": [],
    "knownClientApplications": [],
    "logoUrl": null,
    "logoutUrl": null,
    "name": "RentReady",
    "notes": null,
    "oauth2AllowIdTokenImplicitFlow": true,
    "oauth2AllowImplicitFlow": true,
    "oauth2Permissions": [],
    "oauth2RequirePostResponse": false,
    "optionalClaims": null,
    "orgRestrictions": [],
    "parentalControlSettings": {
        "countriesBlockedForMinors": [],
        "legalAgeGroupRule": "Allow"
    },
    "passwordCredentials": [],
    "preAuthorizedApplications": [],
    "publisherDomain": "rentreadytrialtest.onmicrosoft.com",
    "replyUrlsWithType": [
        {
            "url": "https://localhost",
            "type": "Web"
        }
    ],
    "requiredResourceAccess": [
        {
            "resourceAppId": "00000007-0000-0000-c000-000000000000",
            "resourceAccess": [
                {
                    "id": "78ce3f0f-a1ce-49c2-8cde-64b5c0896db4",
                    "type": "Scope"
                }
            ]
        },
        {
            "resourceAppId": "00000003-0000-0000-c000-000000000000",
            "resourceAccess": [
                {
                    "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
                    "type": "Scope"
                }
            ]
        }
    ],
    "samlMetadataUrl": null,
    "signInUrl": null,
    "signInAudience": "AzureADMultipleOrgs",
    "tags": [],
    "tokenEncryptionKeyId": null
}

I have removed the App Id from this manifest for security reasons. Sharing the postman configuration.

enter image description here

I have removed the App ID here as well for security concerns. After authorizing using both as a postman and on a web browser I am having the same error.

enter image description here

1 Answers1

0

First you need to get an access token from Azure AD with the Client ID, Client secret and your tenant ID. The last object to send is your scope. The scope is defined as: HTTPS://yourorgurl.crmx.dynamics.com/.default

The return is an access token which you can use to access your data.

Also, don’t forget to add your client registration as app user in your environment.

Iona Varga
  • 509
  • 2
  • 8