# 401 Bad Credentials from Github running Drone on GKE

**URL:** <https://drone.discourse.group/t/401-bad-credentials-from-github-running-drone-on-gke/9783>\
**Category:** Drone Support\
**Created:** [October 31, 2018, 1:44pm UTC](https://drone.discourse.group/t/401-bad-credentials-from-github-running-drone-on-gke/9783 "2018-10-31T13:44:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoitsro](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yoitsro/32/4380_2.png) [@yoitsro](https://drone.discourse.group/u/yoitsro)\
**Post date:** [October 31, 2018, 1:44pm UTC](https://drone.discourse.group/t/401-bad-credentials-from-github-running-drone-on-gke/9783/1 "2018-10-31T13:44:39Z")

</div>

For some reason, I’m unable to authenticate against GitHub. Every time I try, I see the following error in my logs:

```auto
cannot authenticate user. GET https://api.github.com/user: 401 Bad credentials []

```

My setup is as follows:

I’m using Google Kubernetes Engine using this helm chart: [https://github.com/helm/charts/tree/master/stable/drone](https://github.com/helm/charts/tree/master/stable/drone)

I’ve customised the chart with the following values to give me TLS and to work with my GitHub oauth app:

```auto
ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: "gce"
    kubernetes.io/tls-acme: "true"
    kubernetes.io/ingress.allow-http: "false"
  hosts:
    - ci.orgname.io
  tls:
    - secretName: drone-tls
      hosts:
        - ci.orgname.io
server:
  host: "https://ci.orgname.io"
  env:
    DRONE_ADMIN: "yoitsro"
    DRONE_GITHUB_CLIENT: "ACTUAL CLIENT ID"
    DRONE_GITHUB_SECRET: "${DRONE_GITHUB_SECRET}"
    DRONE_GITHUB: "true"
    DRONE_OPEN: "true"
    DRONE_ORGS: "orgname"
    DRONE_PROVIDER: "github"
envSecrets:
  - DRONE_GITHUB_SECRET
service:
  httpPort: 80
  nodePort: 32015
  type: NodePort
persistence:
  storageClass: "ssd"

```

I’ve tried using the same oauth app against drone running in a local docker-compose setup and everything works as expected. This problem only seems to exhibit itself when running Drone on Kubernetes on GKE.

Any ideas?

---

<div class="post-metadata">

**Author:** ![yoitsro](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yoitsro/32/4380_2.png) [@yoitsro](https://drone.discourse.group/u/yoitsro)\
**Post date:** [October 31, 2018, 2:12pm UTC](https://drone.discourse.group/t/401-bad-credentials-from-github-running-drone-on-gke/9783/2 "2018-10-31T14:12:07Z")

</div>

Interesting - I seem to have “solved” the issue. The `DRONE_GITHUB_SECRET` which should have been pulling from a Kubernetes secret wasn’t coming through properly.

Once I hardcoded the secret, it started authorising properly.
