# 401 Unauthorized Error on a Single Device – Missing Headers Issue

**URL:** <https://community.auth0.com/t/401-unauthorized-error-on-a-single-device-missing-headers-issue/183757>\
**Category:** Get Help\
**Tags:** user-authorization-rbac, directory-authorization\
**Created:** [March 12, 2025, 7:27am UTC](https://community.auth0.com/t/401-unauthorized-error-on-a-single-device-missing-headers-issue/183757 "2025-03-12T07:27:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FilipB](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/filipb/32/72727_2.png) [@FilipB](https://community.auth0.com/u/FilipB)\
**Post date:** [March 12, 2025, 7:27am UTC](https://community.auth0.com/t/401-unauthorized-error-on-a-single-device-missing-headers-issue/183757/1 "2025-03-12T07:27:59Z")

</div>

Hey everyone,

I’m running into a 401 Unauthorized error, but only on one specific device. The issue seems to be that this device doesn’t add headers to the request, while all other devices work just fine.

I can successfully retrieve the token in the app and verify that it’s valid, but Auth0 blocks header addition on this one device.  
Here’s what I get in the logs:

\_HttpHeaders {headers: undefined, normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}

```auto

What I’ve tried so far:

 Cleared cookies, cache, and temp files
 Logged out and back in
Still no luck 😔

Does anyone know how to fix this?

Here’s my code for retrieving headers. Maybe I’m missing something?

getAuthHeaders(): Observable<HttpHeaders> {
  return this.auth0.getAccessTokenSilently().pipe(
    catchError((error) => {
      console.error('Error fetching token:', error);

      if (error.error === 'login_required' || error.error === 'consent_required') {
        this.auth0.loginWithRedirect();
        return throwError(() => new Error('Login required'));
      }

      return throwError(() => new Error('Failed to fetch token'));
    }),
    switchMap((token) => {
      try {
        const decodedToken: any = jwtDecode(token);
        const tenant_id = decodedToken.tenant_id;

        const headers = new HttpHeaders()
          .set('Authorization', `Bearer ${token}`)
          .set('tenant-id', tenant_id);

        return of(headers);
      } catch (decodeError) {
        return throwError(() => new Error('Token decoding error'));
      }
    })
  );
}

```

I’m certain the backend isn’t the issue, as the problem **only occurs on this one device** when there’s a route guard.

Any ideas? Thanks in advance! 🚀

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [March 31, 2025, 4:43pm UTC](https://community.auth0.com/t/401-unauthorized-error-on-a-single-device-missing-headers-issue/183757/3 "2025-03-31T16:43:34Z")

</div>

Updating as the discussion moved to the DM,

The issue most likely occurs due to the company’s hardware security software.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 14, 2025, 4:44pm UTC](https://community.auth0.com/t/401-unauthorized-error-on-a-single-device-missing-headers-issue/183757/4 "2025-04-14T16:44:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
