title: Azure Active Directory get token request http error
body: <p>I'm using Active Directory Authentication library for python following the <a href="https://github.com/AzureAD/azure-activedirectory-library-for-python#acquire-token-with-client-certificate" rel="nofollow noreferrer">documentation</a>. Earlier on I managed to get the access_token through the <a href="https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/dev/sample/client_credentials_sample.py#L46-L55" rel="nofollow noreferrer">Acquire Token with Client Credentials sample</a>:</p>
  
  <pre><code>import adal
  
  RESOURCE_URI = 'https://&lt;mydomain&gt;.crm.dynamics.com'
  AUTHORITY_URL = "https://login.microsoftonline.com/&lt;tenant_id&gt;"
  CLIENT_ID = 'xxxx'  #application_id
  CLIENT_SECRET = 'xxxx'
  
  context = adal.AuthenticationContext(AUTHORITY_URL)
  token = context.acquire_token_with_client_credentials(
      RESOURCE_URI,
      CLIENT_ID,
      CLIENT_SECRET)
  print token
  </code></pre>
  
  <p>But I get an error message when I tried the <a href="https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/dev/sample/refresh_token_sample.py#L47-L69" rel="nofollow noreferrer">Acquire token and Refresh token sample</a> </p>
  
  <pre><code>context = adal.AuthenticationContext(AUTHORITY_URL)   
  token = context.acquire_token_with_username_password(
      RESOURCE_URI,
      USERNAME,
      PASSWORD,
      CLIENT_ID)
  
  print token
  
  &gt;&gt;&gt; adal.adal_error.AdalError: Get Token request returned http error: 401 and server response: {"error":"invalid_client","error_description":"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.........."correlation_id"......}
  </code></pre>