Invalid Client Error when Requesting Refresh token

I am trying to generate refresh token using https://one.openemr.io/a/openemr/oauth2/default/token endpoint . I am however getting an invalid client error. I have confirmed that the client is enabled and am authenticating the request by basic auth using client id and client secret. Please assist.