How to Fix Failed to Login: Bad Login in Minecraft
Fix the 'Failed to login: Bad login' or 'Invalid session' error in Minecraft multiplayer. Covers authentication token refresh, session issues, and account problems.
How to Fix Failed to Login: Bad Login in Minecraft
The Error
Failed to login: Bad login
Failed to verify username!
Invalid session (Try restarting your game and the launcher)
This error occurs when the Minecraft server contacts Mojang's authentication servers to verify your session token and the verification fails. The server rejects your connection because it cannot confirm your identity. This is an authentication issue, not a network or connection issue.
Quick Fix
Close Minecraft completely, close the launcher, then reopen the launcher and log in again. This refreshes your session token. Wait 30 seconds, then connect to the server.
Step-by-Step Diagnosis
- Restart the launcher. Close the game and the launcher entirely (check the system tray). Reopen the launcher and sign in. Your session token is refreshed on each login.
- Check Mojang authentication servers. Visit status.mojang.com or check Downdetector. If the auth servers are down, you cannot join any online-mode server until they come back.
- Wait 30 seconds after logging in. Sometimes the session token takes a moment to propagate to all Mojang servers. Connecting immediately after launching may fail.
- Do not run multiple instances. Running two Minecraft clients with the same account simultaneously invalidates one session. Close all other instances.
- Clear the launcher cache. In the official launcher, go to Settings and clear the cache. In third-party launchers, log out and log back in to force a fresh token.
- Check your system clock. Authentication tokens are time-sensitive. If your system clock is wrong by more than a few minutes, token validation fails. Sync your clock: on Windows, go to Settings, Time & Language, and click "Sync now". On Linux, run
sudo timedatectl set-ntp true.
Common Causes
- Expired session token. Session tokens expire after about 24 hours of inactivity. Restarting the launcher generates a new one.
- Multiple instances on the same account. Launching a second client invalidates the first client's token. Only one instance can be active at a time.
- Mojang auth server outage. If Mojang's session servers are down, all online-mode servers become unreachable. This is temporary and resolves on its own.
- Wrong system clock. OAuth tokens have an expiry time based on your system clock. A clock that is hours or days off causes immediate token rejection.
- VPN or proxy interference. Some VPNs route auth requests through different regions, causing IP mismatch detection. Disable VPN and try again.
Server-Side Notes
If you are a server administrator and many players report "Bad Login" simultaneously, check if your server can reach sessionserver.mojang.com. Run curl -I https://sessionserver.mojang.com from your server. If it times out, your hosting provider may be blocking outbound HTTPS traffic or the Mojang servers are down.
Setting online-mode=false in server.properties disables authentication checks entirely, but this is a major security risk. Anyone can join with any username, including impersonating existing players. Never disable online mode on a public server.
FAQ
Why does "Bad Login" only happen on some servers?
Servers with online-mode=false (offline mode or behind a proxy like Velocity) skip authentication checks, so you will not see this error on those servers. Online-mode servers always verify your token.
I restarted and it still does not work. What else can I try?
Log out of your Microsoft account in the launcher, close the launcher, reopen it, and log in fresh. If you migrated from a Mojang account to Microsoft, make sure you are logging in with the correct Microsoft email.
Does this error mean my account was hacked?
Not necessarily. "Bad Login" is almost always a token issue, not a security breach. However, if you also receive emails about unauthorized password changes, secure your Microsoft account immediately and enable two-factor authentication.
Need a server that handles all this? Astroworld Hosting, NVMe SSDs, Pterodactyl panel, DDoS protection on every plan.