# Query on reauthorize on token expiry behaviour on device & server

**URL:** <https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553>\
**Category:** General Discussions\
**Created:** [February 18, 2020, 4:05am UTC](https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553 "2020-02-18T04:05:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pei.cei](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@pei.cei](https://hub.mender.io/u/pei.cei)\
**Post date:** [February 18, 2020, 4:05am UTC](https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553/1 "2020-02-18T04:05:06Z")

</div>

Hello,

What is the behaviour on token expiry? The device will request to reauthorize, any limits on the token reissuing? In my locally hosted mender, a device which has 32 tokens in deviceauth-\> token db and no new tokens are generated. Device is sending the request to get 401 response.

Regards,  
Pei

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [February 18, 2020, 8:20am UTC](https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553/2 "2020-02-18T08:20:24Z")

</div>

@alfrunes, for you?

---

<div class="post-metadata">

**Author:** ![alfrunes](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/alfrunes/32/703_2.png) [@alfrunes](https://hub.mender.io/u/alfrunes)\
**Post date:** [February 18, 2020, 10:16am UTC](https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553/3 "2020-02-18T10:16:39Z")

</div>

Hi,

As you say, the client will attempt to request a new token on expiry (actually on all unauthorized requests to the API). There are no limits on the number of token reissuing, a new token will be generated with an updated expiry timestamp on a new request. About the 401 response code, have you authorized the device in question? If so could you please attach logs for the deviceauth service? Else you might want to login to the server and hit the accept button in the UI.

---

<div class="post-metadata">

**Author:** ![pei.cei](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@pei.cei](https://hub.mender.io/u/pei.cei)\
**Post date:** [February 18, 2020, 2:00pm UTC](https://hub.mender.io/t/query-on-reauthorize-on-token-expiry-behaviour-on-device-server/1553/4 "2020-02-18T14:00:10Z")

</div>

Hi @alfrunes,

Thanks for the clarification. The device is authorized, hence, I dont see it in the pending list. Accidentally, I reboot the device, now I am not seeing this error anymore.
