Trying to understand if I can add authentication to alloy using oauth2 proxy service

I have alloy being exposed using traefik ingress. I send metrics from my frontend through browser to /collect endpoint on alloy.

Now, I want to add some authentication to alloy UI using oauth2 proxy service (that intercepts my requests to alloy and redirects for authentication) as well as any requests to alloy Faro /collect endpoint.

I should be able to send a bearer token in headers to /collect endpoint, and it should allow only authenticated requests.
I have traefik, oauth2proxy service, authentik, alloy running on my cluster. Looking for a suggestion on how to implement the above scenario.

1 Like