Usually caused by: your side
What does 401 Unauthorized mean?
401 means the server requires authentication and the credentials sent are missing or wrong. Often the browser opens a small login box for it (HTTP basic authentication); with APIs a valid token is usually missing.
Unlike 403, access is possible in principle – just not without valid credentials.
Is it me or the website?
It is almost always the credentials, so on your side. If you see it on a public page, the owner has probably left a password protection on by mistake.
What you can do as a visitor
- Check user name and password, mind caps lock.
- Stored wrong credentials usually only disappear after restarting the browser.
- Sign out and in again if your session has expired.
- If you have no access, contact the site owner.
What you can do as the site owner
- Check the protection setup, for example
.htpasswdandAuthTypeon Apache orauth_basicon nginx. - Remove password protection from staging sites before going public.
- For APIs: check validity and permissions of the token.
- Monitoring services need a publicly reachable page – or their own credentials.