title: Mule OAuth2 using Client Credentials as grant_type
body: <p>My requirement is to use client_credentials grant_type of OAuth2 to obtain the access token in Mule. I want to implement a OAuth enabled custom connector. I am unable to achieve it using following configuration:</p>
  
  <pre><code>&lt;XXX-auth2:config name="TestAuth" consumerKey="abc" consumerSecret="1234" doc:name="TestAuth"&gt;
          &lt;XXX-auth2:oauth-callback-config domain="localhost" localPort="8082" path="callback" remotePort="8082" async="false"/&gt;
      &lt;/XXX-auth2:config&gt;
      &lt;flow name="testFlow1" doc:name="testFlow1"&gt;
          &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082"  path="testoauth" doc:name="HTTP" /&gt;
           &lt;XXX-auth2:authorize config-ref="TestAuth" doc:name="TestAuth"/&gt;
          &lt;logger message="Test Auth output:#[flowVars['tokenId']]" level="INFO" doc:name="Logger"/&gt;
      &lt;/flow&gt;
  </code></pre>
  
  <p>My requirement is to manage OAuth protected calls from a batch job. Please suggest.</p>