## TL;DR

[M.Ali (accepted answer)] I solved the problem! you need to logout firebase logout then log-in firebase login again or just refresh the token with firebase login --reauth it seems that the expiry time of Firebase auth token is limited to max 1Hr Context: Stack Overflow #52891500 (accepted answer, 648 votes, 5 answers): I`m trying to set up firebase functions, but I get an error after running firebase init.

## Steps

1. [M.Ali (accepted answer)] I solved the problem! you need to logout firebase logout then log-in firebase login again or just refresh the token with firebase login --reauth it seems that the expiry time of Firebase auth token is limited to max 1Hr

## When to use

You are seeing this: Error: HTTP Error: 401, Request had invalid authentication credentials. Use this skill when you run into "HTTP Error: 401 while setting up firebase cloud functions for android project".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://developers.google.com/identity/sign-in/web/devconsole-project
