Create user with admin rest api, enable email login on. error: 401 not authorized

I have changed the settings in the keycloak for the users to be able to use email as their log ins. But since then i can not make through the keycloak to return the response, it just throws the error 401 not authorized, i have researched, tried a lot of things and none of them worked. I have admin-cli client and another string300 client and i have service accounts turned on and if i change the grant type settings but then i get my client is not eligible for external service account usage. Nothing works for me