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:
This is my config:
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
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?
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/
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
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/
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156