Hi,
I am referring MSDN article for Management Libraries for .NET to access my Azure AD account.
I followed all steps from article, but when my application execution starts it gives an error
"An unhandled exception of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException' occurred in Microsoft.IdentityModel.Clients.ActiveDirectory.dll
Additional information: AADSTS90014: The request body must contain the following parameter: 'client_secret or client_assertion'."
c# block where I caught in error--
--------------------------------------------------------
AuthenticationResult result = context.AcquireToken(
ConfigurationManager.AppSettings["apiEndpoint"],
ConfigurationManager.AppSettings["clientId"],
new Uri(ConfigurationManager.AppSettings["redirectUri"]));
---------------------------------------------------------
my context variable as below
-----------------------------------------------------------
var context = new AuthenticationContext(string.Format(
ConfigurationManager.AppSettings["login"],
ConfigurationManager.AppSettings["tenantId"]));
-------------------------------------------------------------
and when I am trying to add client_secrete key to code
--------------------------------------------------------------
AuthenticationResult result = context.AcquireToken(
ConfigurationManager.AppSettings["apiEndpoint"],
new ClientCredential("*******", "******"),
new UserAssertion("*****", "client_credentials", "*****"));
--------------------------------------------------------------
throws an error
--------------------------------------------
An unhandled exception of type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException' occurred in Microsoft.IdentityModel.Clients.ActiveDirectory.dll
Additional information: AADSTS50027: Invalid JWT token. AADSTS50027: Invalid JWT token. Token format not valid.
---------------------------------------------
please tell me proper solution where I making mistake and also help to find Assertion key value for application which are added on Azure AD portal.
thanks,
Yogesh