I solved my problem.
It was because I created an anonymous access in elastichsearch.yml
This could not allow me to be privileged for roles.
Now if I keep this out when I create an elastichsearch request it asks me for username and password.
Is there a way to have both? I mean, you can create different roles with different privileges and elastichssearch doesn't ask for username and password or can create a anonymous access without this issues
Thank you