Skip to content

Header authorization method return 401 #9865

Open
@Andrew1988123123

Description

@Andrew1988123123

What happened?

Using header authorization method I get 401. The token is correct because in the last step I enter the token manually and it allows me to log in.

What did you expect to happen?

I will not get 401 error code and I will log in using header authorization method https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/README.md#authorization-header)](https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/README.md#authorization-header

How can we reproduce it (as minimally and precisely as possible)?

Install the following components and generate a token for any role.

helm install kubernetes-dashboard k8s-dashboard/kubernetes-dashboard --version 7.10.1
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx --version 4.11.4 --set controller.allowSnippetAnnotations=true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: HTTPS
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Il...";
spec:
  ingressClassName: nginx
  rules:
    - host: localhost
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: kubernetes-dashboard-kong-proxy
                port:
                  number: 443
20250118-1224-00.9984211.mp4

Anything else we need to know?

No response

What browsers are you seeing the problem on?

No response

Kubernetes Dashboard version

7.10.1

Kubernetes version

k3d v1.31.0+k3s1

Dev environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions