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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans