web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Get error when try to access Dynamics CRM entities in my application

(0) ShareShare
ReportReport
Posted on by 10

I am planning to access Dynamics CRM entities in my flutter application, After getting client id and tenant from AZURE ACTIVE DIRECTORY, Now I need scope to access Dynamics CRM entities.

From PowerApp at the Developer resources I get Web API endpoint:

Screenshot_5F00_2022_2D00_01_2D00_11_5F00_11_2D00_57_2D00_46.png


This is my config:

Screenshot_5F00_2022_2D00_01_2D00_11_5F00_11_2D00_59_2D00_21.png

When I am trying to get token :

void login() async {
try {
await oauth.login();
String? accessToken = await oauth.getAccessToken();
print('------------> $accessToken');
} on Exception catch (e) {
print('------------> $e');
}
}

I got this error:

I/flutter ( 7460): ------------> Exception: Access denied or authentication canceled.

When I used `scope: "openid profile offline_access",` I received token. What is a problem ?

Even When I past `Web API endpoint` in browser I got :

This page isn’t workingIf the problem continues, contact the site owner.
HTTP ERROR 401

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Get error when try to access Dynamics CRM entities in my application

    Hi,

    I hope you have selected Dynamics CRM User impersonation under Api permission in your Azure AD App registration.

    docs.microsoft.com/.../walkthrough-register-app-azure-active-directory

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • alt2020 Profile Picture
    10 on at
    RE: Get error when try to access Dynamics CRM entities in my application

    Screenshot_5F00_2022_2D00_01_2D00_11_5F00_13_2D00_28_2D00_27.png

    This is Api permissions and some part of  manifest: 

    	"acceptMappedClaims": null,
    	"accessTokenAcceptedVersion": null,
    	"addIns": [],
    	"allowPublicClient": true,
    	"appId": "e901ac4c-9b37-4ec8-ba87-c6703359404f",
    	"appRoles": [],
    	"oauth2AllowUrlPathMatching": false,
    	"createdDateTime": "2022-01-11T08:04:15Z",
    	"description": null,
    	"certification": null,
    	"disabledByMicrosoftStatus": null,
    	"groupMembershipClaims": null,
    	"identifierUris": [],

    But I still that error

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Get error when try to access Dynamics CRM entities in my application

    Hi,

    have you enabled ID Token under Authentication tab in App registration page?

    Please have a look at my blog -

    xrmdynamicscrm.wordpress.com/.../

    Also, in scope pass only base URL and remove /api/data/v9.2

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • alt2020 Profile Picture
    10 on at
    RE: Get error when try to access Dynamics CRM entities in my application

    There is no Token Part under Authentication, seems I have to make so in Token configuration  I choose to Add optional claim, After opening a modal I have to select the token type. I will select ID but int the lower list which token I have to select? Claim, acct,auth_time or ...?

    Is the right step?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans