Can a VPN Affect Time-Based Authentication for Remote Work Portals?
A VPN does not change your device clock, and one-time codes are calculated from it. Here is what a VPN can and cannot affect when you sign in to a remote work portal.
10 min readUpdated Nov 16, 2026By XPASS Editorial Team

You open your employer's portal, type your password, and the page asks for a six-digit code from your authenticator app. You type it in, and it is rejected. A moment earlier you connected a VPN, so the VPN becomes the obvious suspect. Does a VPN somehow tamper with the code? Does it change the time?
The short answer is that a VPN does not change your device clock, and a time-based code is calculated from that clock, not from your network. This article explains how those codes work, what a VPN does touch during a work sign-in (mainly your IP address and the route your traffic takes), where the real causes of rejected codes usually are, and how to troubleshoot calmly without trying to get around any security check your employer has set up.
How time-based one-time codes work
A time-based one-time password, often shortened to TOTP, is the six-digit code that changes every 30 seconds or so in an authenticator app. It is defined in a public standard, RFC 6238. The idea is simple. When you first enrol, the portal and your authenticator app share a secret value. From then on, both sides run the same calculation: take the shared secret, take the current time (counted in short steps of about 30 seconds), and produce a short number from the two.
Notice what is not in that recipe. Your IP address is not part of the calculation. Your location is not part of it. Your network, your Wi-Fi name and your VPN status are not part of it either. Only two things go in: the shared secret and the current time on each side. If both sides agree on the time, they produce the same code. If they disagree by more than the portal allows, the codes differ and your entry is rejected.
Because nothing is sent over the network while the code is being generated, the app can work in airplane mode. It reads the clock of the device it runs on, does the calculation locally and shows the result. The only network step comes afterwards, when you type the code into the portal and the portal checks it against its own calculation.

What a VPN does and does not change
A VPN app creates an encrypted tunnel between your device and a VPN server. Your traffic travels through that tunnel, and websites see the VPN server's public IP address instead of the one your home or mobile provider gave you. That is the whole job. If you want a refresher, what a public IP address is is a good starting point, but you do not need it to follow this article.
Here is how the pieces line up:
| Item | Changed by connecting a VPN? | Why it matters for a code |
|---|---|---|
| Device clock (date, time, time zone) | No | Codes are calculated from it |
| Shared secret in the authenticator app | No | Stored on the device, never sent through the VPN |
| The code shown by the app | No | Calculated locally |
| Public IP address the portal sees | Yes | The portal may use it in its own risk checks |
| Apparent location based on IP | Often | May trigger extra verification |
| Route and speed of your traffic | Yes | Can slow the page, or cause a timeout |
The first three rows are the key point. A VPN does not reach into your phone and alter the clock, the secret or the code. What it does change is what the portal can see about the connection, and that can affect the sign-in in other ways, which the next sections cover.
Why a code can still be rejected while a VPN is on
If the VPN does not change the clock, why does it sometimes feel as if it does? Usually because several things happened close together, and the VPN was the most visible one. Here are the common real causes.
The device clock is wrong
This is the single most common reason for rejected codes, with or without a VPN. If the date, the time or the time zone on the phone is off, the app calculates a code for a different moment than the portal expects. Clocks can be wrong because automatic time is switched off, because a travel setting moved the time zone, because the battery was fully drained and the device restarted with a stale time, or because someone set the date manually. Our companion article on how a wrong clock can break VPN authentication goes deeper on this, including what the symptoms look like.
The code expired while you were typing
Codes are valid for a short window. If the page was slow to load, perhaps because traffic was taking a longer route through the VPN, you might type a code that was fresh when you read it but stale when the portal checked it. The fix is boring but effective: wait for the next code to appear, then enter it quickly.
The portal treats a new IP address differently
Many work portals evaluate more than the password and the code. They may look at the network address, the rough location it suggests, whether the device is known and how recent the last sign-in was. Connecting through a VPN gives the portal a different address from the one it normally sees. Depending on how your employer configured the portal, that may lead to an extra verification step, a block, or a message that the sign-in looks unusual. This can look like a rejected code when it is really a policy decision. We cover what such checks look like in identity verification checks and VPNs.
The session was interrupted midway
A sign-in is a short conversation between your browser and the portal. If the connection drops or switches network between the password step and the code step, the portal may lose track of which attempt the code belongs to. Your IP address changing in the middle of a session can cause this too, and the article on what happens when a session's public IP changes explains it in detail.
Too many attempts
Some portals lock or pause an account after several wrong codes. If you keep retrying quickly, the real problem becomes the lock, not the code. Slow down after two or three failures and look for the cause instead.
A calm troubleshooting order
When a time-based code is rejected, work through the checks below in order. Each takes under a minute, and none of them involves bypassing any control.
- Wait for a fresh code. Do not retry the same one. Let the app roll over to the next code and enter it right away.
- Check the clock on the device that makes the code. Open the settings for date and time. Make sure the date, time and time zone are correct for where you are.
- Turn on automatic date and time. On most phones and computers there is a switch for "set automatically" or "use network time". Turning it on lets the operating system correct itself. Turn on automatic time zone too if it is offered.
- Retry on the same network, once. Sign in again with a new code. If it now works, the clock was the problem.
- Note whether the failure is a code error or a different message. A message about an unusual sign-in, an unrecognised device or a location is a portal policy message, not a clock problem. Write down the exact wording; your IT team will want it.
- Check the VPN separately. Confirm your VPN connection is stable and that pages load normally. If the VPN is struggling, the connection may time out partway through sign-in. Fix any connection problem first, then try the sign-in again.
- Contact your IT team. If you have followed the steps and the codes are still rejected, the secret may need re-enrolling, which only your employer can arrange.
If you are testing, change one thing at a time. Fix the clock, then try. Then adjust the VPN, then try. Changing everything at once makes it impossible to see what helped.
Should you use a VPN with an employer's portal at all?
This depends entirely on your employer's rules, and it is worth being honest about that. There are three common situations.
The employer requires its own VPN. Many organisations run a company VPN so that staff can reach internal systems. In that case you should use the company VPN as instructed. A personal VPN is a separate tool and is not a replacement. The NIST guidance on telework and remote access security describes why organisations put such controls in place.
The employer restricts or forbids personal VPNs. Some policies say personal VPNs must not be running when you sign in to work systems. If your policy says this, follow it. A personal VPN is not a way to hide your location from an employer or to get around a rule they set, and this article does not suggest it.
The employer has no objection. Some workplaces are happy for staff to use a personal VPN on public Wi-Fi, for example in a hotel or a café, because it adds a layer of protection on an untrusted network. Even then, the portal may react to the new address, so expect the occasional extra check.
If you are not sure which situation applies, ask. It is a short email, and the answer saves a lot of confusion later. A broader look at the topic is in choosing a VPN for remote work.
A plain example
Nina works remotely and travels for a week. At a cafe she connects a personal VPN on her laptop for safer browsing, then opens her company portal. The portal accepts her password and asks for the code from her phone app. She types it, and it fails. She tries again twice, and it fails again, and the portal then pauses her account for fifteen minutes.
Her first thought is that the VPN broke the code. Looking back, the timeline tells a different story. During the flight her phone moved to a new time zone, but its date and time had been set manually months earlier, so it kept showing the old time. The authenticator app used that wrong time, and every code it produced was for the wrong moment. The VPN was a coincidence: it was simply the thing she changed that day.
She turns on automatic date and time on the phone, waits for the lock to end, enters a fresh code, and signs in. Later the portal shows a notice that the sign-in came from a new location, which is the portal's own check and has nothing to do with her code. She confirms it was her through the portal's normal prompt. Two separate things, a clock problem and a new-location notice, had looked like one.

What this means for different kinds of codes
Not every second factor works the same way, and the VPN question has slightly different answers for each.
| Type of second factor | Depends on device clock? | VPN effect |
|---|---|---|
| Authenticator app codes (TOTP) | Yes | None on the code; portal may still react to the new IP |
| Text message codes | No, the carrier sends them | Network or roaming may delay delivery; VPN does not change the code |
| Push approval in an app | No | The approval needs a working connection; VPN routing may affect speed |
| Hardware security key or passkey | Generally not clock-based | Depends on the portal; a VPN does not alter the key |
| Printed backup codes | No | Not affected |
The takeaway is that only authenticator-style codes rely on the device clock. For the others, trouble with a VPN tends to come from connection quality or from the portal's risk checks, not from time. The FIDO Alliance's passkey pages and the CISA guide on multi-factor authentication are good plain-language places to read about the options. If you want the basics of the idea itself, see what two-factor authentication is.
Limits and things to watch for
A few honest limits keep expectations realistic.
- A VPN will not fix a bad code. If the clock, the secret or the account is the issue, a VPN neither helps nor hurts. Do not toggle it hoping it will.
- A correct clock does not guarantee a sign-in. Policy blocks, expired accounts, lockouts and portal outages all produce failures that look similar.
- Do not look for ways around the check. If your employer's portal blocks sign-ins from certain addresses or asks for extra verification, that is a deliberate control. Trying to defeat it, for example by hiding where you are or sharing codes, can break workplace rules and put the account at risk. Ask your IT team instead.
- Never share codes or enrolment secrets. Anyone who asks for your code, including someone claiming to be IT support who contacted you first, deserves suspicion. The CISA page on recognising phishing is a useful reminder.
- A VPN is not a complete security answer. It protects traffic on the network between your device and the VPN server. It does not protect against a phishing page, a compromised device or a stolen password.
- Apps and portals differ. Time windows, retry limits and risk rules vary from one system to another, so treat any number you read as an example, not a rule.
Habits that prevent most problems
You can avoid most of these situations with a few habits.
- Keep automatic date, time and time zone switched on across your phone and computer.
- Save your backup codes or recovery method somewhere safe and separate from the phone, as your employer advises.
- Before a trip, check that your authenticator app still gives accepted codes, and that you know how to reach your IT team from abroad.
- Connect your VPN first, wait until it is stable, and only then open the work portal. Avoid switching networks mid-sign-in.
- If your device battery died completely, check the clock after it restarts.
- If you change phones, move your authenticator enrolment properly using your employer's process, rather than assuming the old codes carry over.
Summary
A VPN does not change your device clock, and time-based codes are calculated from that clock together with a shared secret, not from your IP address or your network. When a code is rejected, the likely causes are a wrong date, time or time zone, a code that expired while you typed, an interrupted sign-in, or a work portal that reacts to a new IP address with its own extra checks. Fix the clock first, use a fresh code, change one thing at a time, and ask your employer's IT team when the portal's rules or your policy are unclear. Never try to defeat a security check.
If you want a VPN for safer browsing on public networks while you work, you can look at the XPASS pricing page and read the setup help before you travel.
Frequently asked questions
Does a VPN change the time on my phone or computer?
No. A VPN carries your network traffic through an encrypted connection. Your device clock is a separate setting managed by the operating system, and connecting or disconnecting a VPN does not change it. Time-based codes are calculated from that device clock.
Why does my authenticator code work without the VPN but fail with it?
The code itself does not depend on the VPN. If the result changes, look at what else changed at the same moment: a new login attempt, a different network, a portal that now sees a different IP address and asks for extra checks, or a clock that was corrected or drifted in between. Test again with a fresh code to find out which.
Can a VPN make a work portal ask for extra verification?
It can. Some portals take the network address, the apparent location and the device into account when deciding how much checking a sign-in needs. A new address may lead to an extra step or a block. That is the portal applying its own rules, not the VPN altering your code.
What should I check first when a time-based code is rejected?
Check the date, time and time zone on the device that makes the code, and turn on automatic date and time. Then wait for the next code and type it promptly. If it still fails, contact your employer's IT team rather than trying to work around the check.
Should I turn the VPN off to sign in to my employer's portal?
Follow your employer's instructions. Some organisations require their own VPN, some forbid personal VPNs on work accounts, and some do not mind. If you are unsure, ask your IT team before connecting a personal VPN.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need a VPN for a short trip or a busy month?
XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.
See passesKeep reading

Troubleshooting
Can an Incorrect System Clock Prevent a VPN from Authenticating?
Yes, a wrong date or time can break a VPN login. Here is why certificates and time-based codes depend on the clock, how to recognise the problem and how to fix it.
10 min read

Buying Guides
Best VPN for Remote Work: What Remote Workers Should Check
A personal VPN and a work VPN do different jobs. This guide explains the difference, how a VPN affects video calls and cloud apps, and a checklist for remote workers and freelancers.
9 min read

Troubleshooting
Why Do Websites Ask You to Verify Your Identity More Often on VPN Connections?
Sign-in checks that appear only on a VPN are usually risk-based, not an error. Learn how new IP and device signals work and how to handle the prompts safely.
10 min read