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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

generate AccessToken by using Azure Active Directory Authentication Library (ADAL) for Java.

(0) ShareShare
ReportReport
Posted on by

Hi there i am new MS dynamics crm using Azure Active Directory Authentication Library (ADAL) for Java, am providing all info but still getting error like 

[Correlation ID: e1d768ca-0fc4-4818-8aff-1e46c1acccb6] Execution of class com.microsoft.aad.adal4j.AcquireTokenCallable failed.

com.microsoft.aad.adal4j.AuthenticationException: {"error_description":"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: f2847e21-a64c-4faa-9811-015951d93700\r\nCorrelation ID: e1d768ca-0fc4-4818-8aff-1e46c1acccb6\r\nTimestamp: 2018-11-07 12:56:02Z","error":"invalid_client"}

My code id like this 

//Azure Application Client ID

finalString CLIENT_ID = "00000000-0000-0000-0000-000000000000";

//CRM URL 

final String RESOURCE = "everlifeai.onmicrosoft.com/";

//O365 credentials for authentication w/o login prompt

final String USERNAME = "xxxxxxxxxx@everlifeai.onmicrosoft.com";

final String PASSWORD = "xxxxxxxxxxxx";

//Azure Directory OAUTH 2.0 AUTHORIZATION ENDPOINT

final String AUTHORITY = "login.microsoftonline.com/common";

7853.method.png

and the error is clearly mentioned that This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator. how can i made active subscriptions for my tenant.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Radu Chiribelea Profile Picture
    6,667 on at

    Can you try to generate a new ClientCredential Object using the username and password

    ClientCredential _clientCredential = new ClientCredential(_clientId, _appKey);

    get then the AuthenticationResuls by calling authContext.AcquireTokenAsync(_crmOrgUrl, _clientCredential).Result;

    Does it work for you like this?

    Regards,

    Radu

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans