# Login Failed. Unauthorized

**URL:** <https://drone.discourse.group/t/login-failed-unauthorized/10504>\
**Category:** Drone Support\
**Created:** [May 8, 2019, 8:25am UTC](https://drone.discourse.group/t/login-failed-unauthorized/10504 "2019-05-08T08:25:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimpenhaus](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kimpenhaus/32/5665_2.png) [@kimpenhaus](https://drone.discourse.group/u/kimpenhaus)\
**Post date:** [May 8, 2019, 8:25am UTC](https://drone.discourse.group/t/login-failed-unauthorized/10504/1 "2019-05-08T08:25:07Z")

</div>

Hi all,

hm - I have a running selfhosted setup with gitea and drone. All on the latest container versions available as they are managed by watchtower. The setup was working quite well with having a repo which is deployed by pushing a new release.

But all of a sudden (I think it might be depending on a container update/ new version) I am not able to log in to drone any more. All I receive is `Login Failed. Unauthorized`

I tried to check the docker logs and I found following:

```
{"level":"debug","msg":"api: authentication required","request-id":"1KwWiathEuoKS7wMx8dyVtgoLiI","time":"2019-05-08T08:14:27Z"}

{"level":"debug","msg":"api: guest access","request-id":"1KwWiathEuoKS7wMx8dyVtgoLiI","time":"2019-05-08T08:14:27Z"}

{"fields.time":"2019-05-08T08:14:27Z","latency":288974,"level":"debug","method":"GET","msg":"","remote":"172.17.0.1:55986","request":"/api/user","request-id":"1KwWiathEuoKS7wMx8dyVtgoLiI","time":"2019-05-08T08:14:27Z"}

{"level":"debug","msg":"events: stream opened","request-id":"1KwWiaIm2FTTnUgu82L1dkjfJr2","time":"2019-05-08T08:14:27Z"}

{"fields.time":"2019-05-08T08:14:27Z","latency":33209,"level":"debug","method":"GET","msg":"","remote":"172.17.0.1:55986","request":"/login","request-id":"1KwWiY7tq7xHoJxRxRCjhRcubMh","time":"2019-05-08T08:14:27Z"}

{"fields.time":"2019-05-08T08:14:27Z","latency":31219,"level":"debug","method":"GET","msg":"","remote":"172.17.0.1:55986","request":"/login/form","request-id":"1KwWiTcEQZFUggGxzxWqQFc8rbY","time":"2019-05-08T08:14:27Z"}

{"level":"debug","msg":"events: stream eror","request-id":"1KwWiaIm2FTTnUgu82L1dkjfJr2","time":"2019-05-08T08:14:27Z"}

{"level":"debug","msg":"events: stream closed","request-id":"1KwWiaIm2FTTnUgu82L1dkjfJr2","time":"2019-05-08T08:14:27Z"}

{"level":"debug","msg":"api: guest access","request-id":"1KwWiaIm2FTTnUgu82L1dkjfJr2","time":"2019-0

```

Not sure if it’s a drone problem or with gitea but also have no idea where to look to see which is the system raising the errors.

Any suggestions on what to do or where to look for the problem?

Thanks, Marcus.

---

<div class="post-metadata">

**Author:** ![kimpenhaus](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kimpenhaus/32/5665_2.png) [@kimpenhaus](https://drone.discourse.group/u/kimpenhaus)\
**Post date:** [May 9, 2019, 7:02am UTC](https://drone.discourse.group/t/login-failed-unauthorized/10504/2 "2019-05-09T07:02:35Z")

</div>

there is an issue regarding @gitea: [https://github.com/go-gitea/gitea/issues/6883](https://github.com/go-gitea/gitea/issues/6883)

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/techknowlogick/32/4245_2.png) [@techknowlogick](https://drone.discourse.group/u/techknowlogick)\
**Post date:** [May 12, 2019, 5:15pm UTC](https://drone.discourse.group/t/login-failed-unauthorized/10504/3 "2019-05-12T17:15:52Z")

</div>

Gitea now is an OAuth2 provider and can more securely provide auth, see: [[Documentation] Document how Gogs/Gitea login works](http://discuss.harness.io/t/documentation-document-how-gogs-gitea-login-works/3762/7) for steps on how to use OAuth2 with Gitea and Drone.

---

<div class="post-metadata">

**Author:** ![kimpenhaus](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kimpenhaus/32/5665_2.png) [@kimpenhaus](https://drone.discourse.group/u/kimpenhaus)\
**Post date:** [May 13, 2019, 6:25am UTC](https://drone.discourse.group/t/login-failed-unauthorized/10504/4 "2019-05-13T06:25:12Z")

</div>

Changed and it’s also working - thanks for the hint.
