I'm trying to add the sonarqube badge to my Gitlab repository.

I've read some answers that talk about this issue for the private project, but it's not the case for me:
[Sonarqube quality badges on gitlab](https://stackoverflow.com/questions/62693253/sonarqube-quality-badges-on-gitlab)

My project is public:

[![sonarqube project's permissions](https://i.stack.imgur.com/PETX9.png)](https://i.stack.imgur.com/PETX9.png)

but still, I get 401 on the badge API endpoint:

```
Request URL: https://{my.sonarqube.domain}/api/project_badges/measure?project={project-key}&metric=alert_status
Request Method: GET
Status Code: 401

```

[![Gitlab project's badges](https://i.stack.imgur.com/yHBW5.png)](https://i.stack.imgur.com/yHBW5.png)

Just to clarify more:
The API endpoint is throwing 401 unless I send the auth token with the request.
But I can't set a basic auth on the Gitlab badge section, Can I?

*Sonarqube Version: 8.9 (build 43852)*