# Alloy UI authentication

**URL:** <https://community.grafana.com/t/alloy-ui-authentication/129757>\
**Category:** Grafana Alloy\
**Tags:** auth\
**Created:** [August 28, 2024, 11:31am UTC](https://community.grafana.com/t/alloy-ui-authentication/129757 "2024-08-28T11:31:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elenacurbelo](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elenacurbelo](https://community.grafana.com/u/elenacurbelo)\
**Post date:** [August 28, 2024, 11:31am UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/1 "2024-08-28T11:31:13Z")

</div>

Hello!

I have Alloy installed in a kubernetes cluster via Helm Chart.

If I want to expose Alloy UI through a public domain, would there be a way to authenticate to get into the UI?

I didn’t find anything related on the docs or on the Helm Chart values.

Thanks!

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 28, 2024, 12:28pm UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/2 "2024-08-28T12:28:15Z")

</div>

maybe prop it behind a proxy server that requires auth like ngnix?

---

<div class="post-metadata">

**Author:** ![elenacurbelo](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elenacurbelo](https://community.grafana.com/u/elenacurbelo)\
**Post date:** [August 28, 2024, 1:00pm UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/3 "2024-08-28T13:00:24Z")

</div>

I was wondering about having already implemented this feature in Alloy itself, but thanks for the answer @yosiasz! Maybe i will explore that option.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 28, 2024, 1:01pm UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/4 "2024-08-28T13:01:14Z")

</div>

so you have resolved it? please share your solution if so

---

<div class="post-metadata">

**Author:** ![elenacurbelo](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elenacurbelo](https://community.grafana.com/u/elenacurbelo)\
**Post date:** [August 28, 2024, 2:36pm UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/5 "2024-08-28T14:36:37Z")

</div>

Yes, it’s resolved now. I followed these instructions to enable the nginx auth: [Basic Authentication - Ingress-Nginx Controller](https://kubernetes.github.io/ingress-nginx/examples/auth/basic/)

I created a secret called `alloy-ingress-auth` with the `htpasswd` credentials on the `auth` secret key.

And the ingress manifest:

```auto
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name: alloy
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    external-dns.alpha.kubernetes.io/ttl: "1m"

    # For basic auth
    nginx.ingress.kubernetes.io/auth-realm: Authentication Required - admin
    nginx.ingress.kubernetes.io/auth-secret: alloy-ingress-auth
    nginx.ingress.kubernetes.io/auth-type: basic

spec:
  ingressClassName: nginx
  rules:
  - host: {{ $alloy_domain }}
    http:
      paths:
      - path: "/"
        pathType: Prefix
        backend:
          service:
            name: alloy
            port:
              number: 12345

  tls:
  - hosts:
    - {{ $alloy_domain }}
    secretName: grafana-alloy-tls

```

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 28, 2024, 2:52pm UTC](https://community.grafana.com/t/alloy-ui-authentication/129757/6 "2024-08-28T14:52:00Z")

</div>

Closed on August 28, 2024, 2:52pm UTC


