title: Enabling CORS on Azure Active Directory
body: <p>I am trying to get a access token from Azure Active Directory programmatically using the following method in an Angular 6 application.</p>
  
  <pre><code>    let body1 = new FormData()
      body1.append("resource", environment.config.clientId)
      body1.append("grant_type", "client_credentials")
      body1.append("client_id", environment.config.clientId)
      body1.append("client_secret", "*****")
  
      return this._http.post("https://login.microsoftonline.com/" + environment.config.tenant + "/oauth2/token", body1)
  </code></pre>
  
  <p>I was able to retrieve an access token through this url in Postman but am blocked by CORS when calling it through my application. Error is below.</p>
  
  <pre><code>    Failed to load https://login.microsoftonline.com/*****/oauth2/token: 
  Response to preflight request doesn't pass access control check: No 'Access-
  Control-Allow-Origin' header is present on the requested resource. Origin 
  'http://localhost:4200' is therefore not allowed access.
  </code></pre>
  
  <p>So, how do I enabled CORS on the Azure Active Directory for all domains? </p>