# Authentication failed for, but running the command again works?

**URL:** <https://forum.gitea.com/t/authentication-failed-for-but-running-the-command-again-works/8521>\
**Category:** Gitea Usages\
**Created:** [February 1, 2024, 11:25pm UTC](https://forum.gitea.com/t/authentication-failed-for-but-running-the-command-again-works/8521 "2024-02-01T23:25:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![No0Vad](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@No0Vad](https://forum.gitea.com/u/No0Vad)\
**Post date:** [February 9, 2024, 7:00pm UTC](https://forum.gitea.com/t/authentication-failed-for-but-running-the-command-again-works/8521/2 "2024-02-09T19:00:53Z")

</div>

I found this setting here [Config Cheat Sheet | Gitea Documentation](https://docs.gitea.com/administration/config-cheat-sheet#oauth2-oauth2)  
Increasing **ACCESS\_TOKEN\_EXPIRATION\_TIME** to 24 hours from 1 hour does improve it.  
It happens way less often now and it works for me.

---

_[View the full topic](https://forum.gitea.com/t/authentication-failed-for-but-running-the-command-again-works/8521)._
