zhigang
zhigang

Reputation: 33

ADAL: The request body must contain the following parameter: client_secret

I wrote the authentication code below with ADAL for android:

mAuthContext = new AuthenticationContext(MainActivity.this, Constants.AUTHORITY_URL,false);
mAuthContext.acquireToken(MainActivity.this, Constants.RESOURCE_ID, Constants.CLIENT_ID,Constants.REDIRECT_URL, Constants.USER_HINT, getCallback());

Windows Azure China version(localized version) has not yet supported to register an app as "native client app", no option at all. So I continue seeing the error below when running the code above.

Server error message:

{"error":"invalid_request","error_description":"AADSTS90014: The request body must contain the following parameter: 'client_secret or client_assertion.

It seems there's no parameters about credentials for "acquireToken" in ADAL Android SDK. Does anyone know how to workaround this?

Upvotes: 3

Views: 13260

Answers (1)

Afshin
Afshin

Reputation: 226

It seems since you could not add a naive client app, you have created a Web app instead which is analogous to confidential client in OAuth protocol. That is why it is asking for client credential. ADAL Android currently does not support confidential clients.

Upvotes: 8

Related Questions