Choose your trial's sign-in session length separately from provider access lifetimes, then test refreshes and failure messages across that session.
Key takeaways
- Check the provider's access lifetime before choosing a refresh schedule.
- Test an idle gap longer than the shortest access lifetime.
- Compare refresh calls for each account with your expected schedule.
- Prepare a clear sign-in message for failed refreshes.
When a free trial lets a new user sign in with a provider account, such as a HubSpot or Slack login, the trial runs on two clocks at once. The first is your app's session: how long your product keeps someone signed in before it asks them to log in again. The second is the provider's access credential: how long the credential your app holds stays valid before the provider stops accepting it. The two numbers often differ. A growth lead who plans the first session without checking the credential clock can end up with a trial that works for the first few minutes and then fails, and the person on the other end blames the product.
This post walks through three credential figures from two official developer guides. Each one changes how you should plan the session, and each one is easy to misread. None of them is a universal rule for every provider. Providers change their numbers, so check the linked pages before you commit to a length.
The reader this post has in mind is a growth lead who owns the first session of a trial that uses a sign-in provider. You may not write the refresh code yourself, but you decide what the first session promises, and that promise depends on credential timing. A first session that promises the user an uninterrupted hour is a claim your engineers have to back up. The sections below explain what the three figures mean, where they are easy to misread, and what to check before the trial opens.
Figure 1: 30 minutes on a HubSpot access credential
HubSpot's OAuth quickstart guide describes the flow your app follows once a user has approved access. It says that after your app receives an authorization code, it can exchange that code for an access credential and a refresh credential by sending a URL-form encoded POST request to the guide's exchange endpoint. The two credentials do different jobs. The access credential is what your app presents when it calls the API on the user's behalf. The refresh credential is what your app keeps so it can get a new access credential later.
The first figure sits on the same page. The guide says the access credential will expire after the number of seconds given in the expires_in field of the response, currently 30 minutes. For a trial, that means the credential behind a fresh sign-in can stop working about half an hour after it was issued, even though the trial itself may run for days.
A short credential lifetime does not have to end the session. The same guide says your app can exchange the received refresh credential for a new access credential by sending a URL-form encoded POST request to the exchange endpoint, using the values the guide lists. If your app makes that exchange in the background, the person may never see the expiry. If it does not, the person sees an error at the moment they try to do something, and that moment often falls in the middle of the first session.
A refresh can also fail for reasons your team does not control, such as a provider outage or a connection the user revoked. The plan should say what your app does in each case, rather than assuming the exchange will always succeed. Treat a failed exchange as a normal event with its own path, because a first session is exactly where an unexpected sign-in prompt does the most damage to trust.
So the planning question changes. Instead of asking how long the user stays signed in, ask whether your app refreshes on its own, and what happens when it cannot. For a first session, test that directly. Sign in with a test account, leave the page idle for longer than 30 minutes, then take an action that calls the provider. Run the test on the same build you plan to ship, not on a version with different settings. If the action works, check the refresh logs to confirm which exchange kept access available. If it fails, you have found the problem before a real trial user did. Use the signup authentication test steps to plan the surrounding sign-in checks.
Write the result down in the plan, not only in the test notes. The plan should name the refresh request your app sends, the response field it reads for the new lifetime, and the place it stores the result. Check that the team can point to the code that reads expires_in and stores the result.
Figure 2: 12 hours on a rotated Slack access credential
Slack's rotation guide covers a different setup, and its number is longer. The guide says you need to call the oauth.v2.exchange API method to exchange a long-lived access credential for a refresh credential and an expiring access credential. Once you have made that exchange, the expiring access credential is the one that sets the timing. The guide states that this credential will always expire in 43,200 seconds, which is 12 hours.
Twelve hours is much longer than thirty minutes, and that is where planners tend to go wrong. A trial that signs in at nine in the morning could, on paper, keep working until nine at night. But the figure is a lifetime, not a promise about the session. The same guide says you'll want to be sure you're prepared to refresh any newly issued or migrated credentials within 12 hours. In other words, the number is a deadline for your refresh work.
Treat any migration as part of the first-session plan, so it does not run into the same window without anyone scheduling it.
That changes the design. Your app needs a refresh step that runs inside the 12-hour window, and that step should not depend on the trial user being active at the right moment. If the only refresh happens when someone clicks a button, a user who stepped away at the wrong time will meet an expired credential. Schedule the refresh well before the window closes, and store the new credential as soon as it arrives. A trial that runs across several days needs this to happen again and again, so the job has to repeat on a schedule rather than run once at sign-in.
Notice what the 12-hour figure does not tell you. It does not say how long your product should keep someone signed in, and it does not say how often your users will come back. Those choices belong to your team. The provider sets the clock on the credential. You set the clock on the session, and the refresh job is what connects the two.
Figure 3: two active credentials before Slack enforces a limit
The third figure is a limit rather than a lifetime, and it is the one a busy first session can hit by accident. Slack's guide says that if you refresh your credentials repeatedly before expiration, for example by calling the oauth.v2.access API method multiple times for the same credential within a 12 hour period, Slack will enforce a limit of 2 active credentials.
The guide also says that calling oauth.v2.access will not immediately invalidate your existing access credential. That sounds reassuring, but read it alongside the limit. The existing credential is not immediately invalidated, but repeated refreshes remain subject to the active-credential limit. A retry loop that refreshes on every failed call can trigger repeated exchanges quickly, even when each refresh looks harmless on its own.
For a first session, the risk is a bug that triggers refreshes over and over. Picture a page that refreshes its credential on every load, a component that retries after a timeout, or two browser tabs open for the same trial user, each one refreshing on its own. Any of these could push one account toward the limit inside the 12-hour window. The trial user then sees sign-in problems that look like a provider outage, and your support queue fills with reports you cannot reproduce.
The fix is mostly about discipline in your code. Refresh only when the stored credential is close to expiry or the provider rejects it. Keep one stored credential for each account, and let every tab read from that store rather than refreshing for itself. Count refresh calls for each account in your logs, so you can spot a loop before a trial user does. A single account that refreshes far more often than your schedule predicts is a signal worth an alert. For the surrounding error handling, review the provider checks before retry.
Decide in advance how many refreshes your schedule expects for each account, and write that number into the plan. Without a stated expectation, nobody can tell whether a count is high. A simple rule works: if an account refreshes more often than the schedule predicts, the code that triggered the extra calls gets reviewed before the next group of trial users arrives. The goal is not to stay under a particular count. It is to keep refreshing tied to real need.
Side by side: the three figures and what each one controls
The table below sets the three figures next to what each one controls and what your first-session plan has to cover. Use it as a checklist to take into a planning meeting. It does not replace the providers' current pages, so check the linked sources before you finalize anything.
| Figure | Provider and guide | Number | What it controls | What the first-session plan must cover |
|---|---|---|---|---|
| Access credential lifetime | HubSpot OAuth quickstart | expires_in seconds, currently 30 minutes | How long one access credential works | A refresh tested after 30 minutes idle |
| Rotated access credential lifetime | Slack rotation | 43,200 seconds (12 hours) | How long the expiring access credential works | A refresh scheduled inside the 12-hour window |
| Active credential limit | Slack rotation | 2 active credentials | The active-credential limit enforced during repeated refreshing | One stored credential for each account, refreshed only when needed |
Your app's own session length is missing from that table on purpose. The provider does not set it, so it is not one of the three figures. Choose it separately, then check it against the two clocks above.
Setting the first session length
Set your app's session length first, in plain terms your team can test. Then map the provider clocks onto it. A common approach is to let the trial user stay signed in for the length your product chooses, and to keep provider access available through refresh for that whole period. That approach only works if the refresh path is reliable, so pick a session length you can actually verify before launch.
Illustrative example: an idle gap crosses expiry
Suppose an access credential lasts 30 minutes. A trial user works for 20 minutes, then leaves the page idle for 20 minutes. On return, the original credential has expired. The next action needs a replacement obtained through a refresh that already happened or happens now. Test that action and check which request performs the exchange. If the refresh fails, confirm that the user sees the planned sign-in message. These illustrative timings test access continuity; they do not choose the app's session length.
A workable sequence for the planning meeting looks like this:
- Write the session length as a rule, such as "a trial user stays signed in through the whole first session," and attach an owner to it. A feeling about the right length will not survive contact with an engineer.
- For each provider the trial uses, write down which credential clock applies and how the refresh is scheduled. For HubSpot, the refresh should happen before the access credential's lifetime runs out. For Slack, the refresh needs to be ready to happen inside the 12-hour window.
- Test an idle gap longer than the shortest credential lifetime your flow relies on. Then take an action that calls the provider and confirm it still works.
- Count refresh calls for each account during the test. Compare the count with what your schedule predicts, and investigate any account that refreshes far more often.
- Decide what the trial user sees when a refresh fails. A clear message that asks them to sign in again is far better than a blank page or a spinner that never stops.
Step five is the one that is easiest to skip. When a refresh fails, the person on the other end has no idea whether the problem is on your side, on the provider's side, or on their own. A short, honest message gives them a way forward and keeps the trial from ending on a confusing screen.
Before the first trial session
Before any real user signs in, run through a short list with engineering and product together. Each item closes a gap that the three figures expose.
- Confirm the current numbers on both guides on the day you plan to launch.
- Confirm which sign-in flow your app uses, because HubSpot and Slack describe different credential setups. Do not assume one provider's numbers apply to the other.
- Ask engineering to walk through the refresh code path, including where the refreshed credential is stored and which process runs the refresh on a schedule.
- Check that every tab, device, and background job reads from the same stored credential rather than refreshing on its own.
- Prepare the message a trial user sees when a refresh fails, and make sure support has the same wording.
- Assign one person to watch refresh counts for each account during the first week of trials, with a clear threshold for escalation.
Most of these checks are conversations and written notes. The refresh schedule is the exception, because it has to keep working long after launch day, when nobody is watching the first session anymore.
Where this leaves the first session
The three figures are inputs to a conversation with engineering, not values to copy into a configuration file. Thirty minutes and twelve hours describe access lifetimes, while two active credentials is a limit on repeated refreshing.
The first session is where those clocks meet a real person. Test them there, on the build you plan to ship, before the trial opens to anyone else. A growth lead who asks the right questions about credential timing will spend less time explaining broken sign-ins later, and the first impression of the trial will be the product working as promised.
Today, run the idle-gap test on your intended release build with engineering. Record whether the next provider action succeeds, which refresh request ran, and what message appears when the exchange fails.
Questions about the first session
Does access expiry have to end the session?
No, a successful refresh can keep provider access available during the app's session. Test the exchange after an idle gap.
What should happen when a refresh fails?
Show a clear message that gives the user a way to sign in again. Check that support uses the same wording.