In https://docs.sentinel-hub.com/api/latest/#/API/authentication, the curl command should use --data-urlencode, at least for the secret.
curl --request POST \
--url https://services.sentinel-hub.com/oauth/token \
--header "content-type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=<client id>" \
--data-urlencode "client_secret=<client secret>"