Configuring Client Credentials

I am trying to authenticate my service account using Client Credentials and it is not working, here is what i did?

  1. Created a client named asdfg
  2. Disabled “Standard Flow”, “Implicit Flow” and “Direct Access Grants” and kept “Service Accounts” and “Authorization” Enabled.
  3. Generated Client Secret.
  4. Configured the information regarding Grant Type and Client Authentication.
  5. Generate Access Token.

However, when i use that token to fetch the info it says “Unknown Error” with status code as 500, not sure what is wrong.

Also, should the username in resource server match the client id? BTW, i have a user named asdfg in my Resource Server. Since it was not working, i created a user with same name in “Users” in key cloak as no where it is mentioned where to mention the service account name.