Client credentials grant flow API, CORS issue

Are you trying to do this all client-side? because you should not be using the Client Credentials flow client-side (eg, within a web page).