title: "error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."
body: <p>we are trying to access a sharepoint api securely using azure oauth2. we got the bearer token but while accessing sharepoint rest api, we are getting Status code: 401 Unauthorized and Response: {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}   </p>
  
  <ol>
  <li>We have registered a client application in azure AD
  a.  Defined redirect uri in authentication
  b.  Mapped access roles to service user account
  c.  Defined client secret
  d.  Defined API permissions and admin consent has been provided</li>
  </ol>
  
  <p>Token Endpoint: <a href="https://login.microsoftonline.com/66395830-4e70-4a10-8f30-225fe9afd23b/oauth2/v2.0/token" rel="noreferrer">https://login.microsoftonline.com/66395830-4e70-4a10-8f30-225fe9afd23b/oauth2/v2.0/token</a></p>
  
  <p>Method: POST
  Body parameters:
  scope:<a href="https://66395830-4e70-4a10-8f30-225fe9afd23b.sharepoint.com/.default" rel="noreferrer">https://66395830-4e70-4a10-8f30-225fe9afd23b.sharepoint.com/.default</a>
  redirect_uri:<a href="https://cscglobal.sharepoint.com/teams/uatCLSService/BusinessLicense/KB/_api/Web/lists" rel="noreferrer">https://cscglobal.sharepoint.com/teams/uatCLSService/BusinessLicense/KB/_api/Web/lists</a>
  grant_type:client_credentials (  note: we have also tried with password and authorization_code values by passing respective parameters )
  client_secret:XXXXXX
  client_id:XXXXX</p>