title: Client Credentials grant with Keycloak as an identity broker for Azure AD
body: <p>I am trying to use client credentials grant for a back-end service using Keycloak as an identity broker for Azure AD. I also need to store access token from external IdP in Keycloak to retrieve group information from MS Graph API. I have this use case working for a confidential client using authorization code flow but I can't get it to work with client credentials grant.</p>
  <p>I have created a &quot;confidential&quot; client in Keycloak with &quot;Service Accounts Enabled&quot; enabled. I have a also created an application in Azure AD with client credentials grant enabled and created a external Identity Provider in Keycloak.</p>
  <p>I get the access token from Keycloak after authenticating using client_id and client_secret but when I try to retrieve external IdP access token from Keycloak endpoint,  I get an error message that says, &quot;User [GUID] is not associated with identity provider&quot;. I'd appreciate any suggestions or feedback.</p>