Magento Open Source customer and admin token lifetimes: what the setting controls
A token lifetime decides how long a stolen or forgotten credential keeps working against your store's REST and GraphQL APIs. Before go-live, a security or platform lead needs to know which token types the store issues, how long each one stays valid, and how quickly a specific token can be ended without disrupting other users. In Magento Open Source, admin tokens are issued to administrator accounts for calls to the admin API areas, while customer tokens are issued to shoppers who sign in through the storefront GraphQL or REST customer endpoints. Both token types are bearer credentials, so anyone who holds the string can use it until it expires or is revoked. The expiry settings for each type sit in the admin configuration and in the token handling code, and they interact with the session and two-factor controls that govern who can sign in at all.
Plan this setting before launch, not after the first incident. Mobile apps and headless front ends usually want long-lived customer sessions so shoppers are not signed out mid-checkout, while administrators and back-office integrations are better served by shorter lifetimes and tight revocation. Those two goals pull in opposite directions, so the trade-off should be written down with the business owner of each channel. Your team should confirm, against the installed version and the Magento documentation for that version, the default lifetime for admin and customer tokens, the configuration path that changes each one, and whether a change needs a cache flush or a reindex to take effect. No lifetime values were confirmed for this page, so do not treat any figure here as a default.
Ask your implementation partner to document the expiry values you chose, the owner who approved each one, and the test that proves an expired token is refused. Include a rehearsal of revoking every token for a departing administrator, since token revocation after staff leave is the control most often missed in offboarding. Record where the change was made so an upgrade or patch does not silently reset it. Refer to the Adobe Commerce upgrade guide overview when you plan how these settings are reviewed at each patch cycle.
Which token types exist and when each lifetime setting fits
This table compares admin tokens, customer tokens and OAuth-based integration tokens by who holds them, where they are used, how they are revoked and which lifetime decision applies. Read each row as a decision: find the client that owns the session, then check the lifetime and revocation path for that token type. Confirm each lifetime setting in your installed version before you change it.
| Token type | Who holds it and where it is used | How it is revoked | Lifetime decision that applies |
|---|---|---|---|
| Admin token | An administrator's login to the Admin panel or a REST call made by an admin user, usually from a browser or a back-office script | Deactivate or lock the admin user, or change the admin account password so existing tokens stop working | Set a short admin session and token lifetime for staff who use shared or unmanaged devices, and confirm the setting in your version's Admin configuration |
| Customer token | A shopper's token for storefront account features, held by a browser or a mobile app that calls REST or GraphQL on the customer's behalf | Customer tokens are revoked when the customer account is disabled or the password changes, and the store can revoke them in bulk | Balance session length against shopper convenience, since mobile apps keep sessions open far longer than browsers; confirm the customer token lifetime setting in your version |
| OAuth integration token | A machine credential issued to an ERP, PIM or marketplace connector through an integration record, used for server-to-server API calls | Revoke or deactivate the integration record, which invalidates its access and consumer tokens; setup is covered on the sibling integration page | Long-lived by design, so rotation and scope matter more than a short timeout; confirm how your version expires and reissues integration tokens |
| Who owns the credential | Named staff for admin tokens, individual shoppers for customer tokens, and a service owner for integration tokens | Ownership determines who must act when someone leaves, moves teams or the connector is retired | Record the owner for every token type in your access register so offboarding covers each one |
| Revocation after staff leave | Admin accounts used by departing staff, plus any integration created by them or wired to their identity | Disable the admin user first, then review integrations they created and rotate any shared secrets | Treat revocation as a checklist, not a single action, and test it on a staging store before the first real departure |
| Mobile app sessions | Customer tokens stored on a device that may be lost, shared or left signed in | Revoke customer sessions after a reported loss or password reset, and confirm the app clears stored tokens on logout | Shorter lifetimes reduce exposure but force more sign-ins; the trade-off should be decided per app with product owners |
| Confirmation needed | Exact lifetime settings, default values and revocation behavior differ by release line | Check the configuration guide and API documentation for your installed 2.4.x version before setting policy | Record the tested values in your hardening baseline so upgrades can be checked against them |
How a token is issued, used, expired and revoked
The flow starts when an admin or customer client sends credentials to the Magento REST or GraphQL endpoint, which issues a token and records it in the store's token storage. Each later request presents the token again, and the store checks it against that record on every call. Tokens leave service in three ways: lifetime expiry, an admin action that revokes them, or a password change. Confirm in your own version which of these revoke existing tokens and how quickly, because the trust boundary sits between the client device or partner system and your store's infrastructure.
Token issuance, use and revocation paths across the client and store boundary.
How lifetime trade-offs play out for mobile apps and integrations
Token lifetime is a single setting that touches four different users: shoppers on mobile apps, unattended integrations, staff in the admin panel, and customers at checkout. Each group pushes the value in a different direction, so the right choice comes from testing how each one behaves at the expiry boundary rather than from a general default.
Mobile apps and staying signed in
A customer or staff member using a native or hybrid app expects to stay signed in across days. A long-lived token keeps that experience smooth, but a stolen phone or a leaked token then grants access until it expires or is revoked. Check how your app stores the token on the device, whether it is cleared on sign-out, and how it behaves when the token is rejected after a long background period. Test a forced expiry on a real device and confirm the app re-authenticates cleanly instead of showing a blank cart or an error loop.
Adobe PHP docsUnattended integrations and mid-job expiry
ERP, PIM and marketplace connectors often run batch jobs overnight with no user present to sign in again. If a token expires halfway through an order export or catalog sync, the job may fail partially and leave records out of step. A long lifetime avoids that failure but leaves a credential valid for a long window if the connector host is compromised. Confirm whether the connector refreshes or re-issues its credential, what it does on a 401 response mid-run, and whether a failed run can resume without duplicating orders. For this kind of client, OAuth-based integrations are usually the better fit, as covered in the sibling integration topic.
Admin sessions and staff friction
Store staff who are interrupted by a sign-out in the middle of a product edit or a refund may lose work or try to work around the control. A short admin lifetime reduces the window in which an unattended browser can be abused, which matters most on shared workstations. Set the value with your security team, then run a realistic workflow: edit a large product, process a refund, and return after a lunch break. Record how often staff are forced to sign in and whether unsaved changes are lost, because that data tells you whether the value is too short for the job.
Customer sessions at checkout
A customer whose session expires while entering payment details may abandon the order, which costs revenue and creates support contacts. A long customer lifetime keeps checkout working but extends the period in which a stolen token can view orders, addresses and saved details. Test the full path: add to cart, wait past the expiry point, then pay. Check that the storefront recovers the cart, does not expose the previous customer's data after sign-out, and shows a clear prompt to sign in again. Include the payment step in the test, because the payment provider's own session behavior can differ.
How to set token lifetimes and verify them before launch
This sequence turns token lifetimes from a default setting into a documented, tested decision for each API client, so the chosen values match how the store's admin, customers, mobile apps and integrations actually connect. It ends with a staging-tested record that the team can review before go-live.
Inventory every API client and its users
List each consumer of the store's APIs: the admin panel, the storefront, any mobile app, the ERP or PIM connector, marketplace feeds and any custom front end. For each one, record who operates it, whether a person signs in or a system runs unattended, which authentication method it uses, and which resources it needs. Owners from the business and the integration team should sign off on the list. The step is done when every client has a named owner and a token type, and nothing is left as an unknown caller.
Confirm the installed version and its token behavior
Record the exact Magento Open Source version and patch level in production and staging, then check the official documentation for that release before changing any setting. Token behavior and admin options can differ between 2.4.x lines, so confirm which settings exist on the version you run. Confirm the support end date for that line with Adobe's lifecycle policy as well. The step is done when the version, patch level and the matching configuration reference are written in the change log.
Set admin and customer token lifetimes
In the Magento Open Source admin configuration, set the admin and customer token lifetime values that the inventory supports. Shorter lifetimes limit how long a stolen token stays useful, but they also force more sign-ins for mobile apps and longer-running users. Record the reason for each value, and ask the mobile app team to confirm how their client handles expiry. The step is done when both values are saved in staging, with the setting path and value captured in the change log.
Separate integration tokens from user tokens
Confirm that machine-to-machine connectors use integration credentials with only the resources they need, and that they are not issued through an admin or customer login. User tokens expire with the session lifecycle, while integration credentials follow their own setup and must be reviewed on their own schedule. Document which clients fall into each group, so an admin lifetime change does not unexpectedly break an ERP sync. The step is done when each client is mapped to exactly one token type with its owner noted.
Test expiry and refresh behavior on staging
On a staging store, use a test admin account, a test customer and a test integration to obtain tokens, wait for expiry or use a controlled test value, then call a protected endpoint with the expired token. The expected result is an authentication error, not a successful response. Next, sign in again or re-issue the credential and confirm the new token works on the same endpoint. Repeat the check for each client type from the inventory, including the mobile app flow. The step is done when every client shows the expected error on expiry and a working token after re-issue.
Define the revocation steps for departing staff
Write a runbook that covers what happens when an admin user leaves or changes role: disabling the account, revoking active admin tokens, and reviewing any integration that the person created or administered. Test the runbook on staging by disabling a test admin account and confirming that its existing token no longer reaches protected endpoints. Confirm with the identity owner whether revocation is also linked to the store's HR or access-review process. The step is done when the test shows the revoked token failing and the runbook has a named owner.
Record the chosen values in the change log
Write the final admin and customer lifetime values, the token type for each client, the test results, the version tested and the revocation runbook into the change log. Include the reviewer and the date the values were approved. Ask the security and integration owners to approve the record before production change. Plan a periodic review tied to the store's patch and upgrade cycle, since client mix and version can change. The step is done when the approved record is stored where auditors and the operations team can find it.
Revoking tokens when staff leave, devices are lost, or a partner is offboarded
The platform or security team should act in the same change window as the HR offboarding ticket. Disabling the admin user stops new logins, but it does not automatically account for everything that user already holds. Admin sessions, admin access tokens and any integration the person created or manages are separate records, and each needs its own check.
- Disable the admin account: Set the user to inactive, then confirm that a login attempt is refused in a private browser session.
- End active admin sessions: Confirm that sessions tied to the account are terminated, not just left to expire on their own.
- Revoke admin tokens: Find tokens issued to that user and revoke them, since they may remain usable after the login is disabled.
- Rotate integration credentials: If the person set up an integration, rotate its consumer key and access tokens, then assign ownership to a current administrator.
- Review recent admin changes: Check the activity for new or edited accounts and roles in the period before the departure.
Confirm in your version how quickly a disabled account's existing tokens stop working, and test with a token issued before the change.
Customer tokens are issued to storefront accounts for API calls and mobile or headless app sessions. The customer may report the problem, or support may receive it, but the action is the same: invalidate the tokens that the lost device or the old password could still use. Support needs a defined procedure, because a wrong account or an unverified caller can lock out a real shopper.
- Customer self-service: Ask whether the storefront or app lets customers sign out other sessions. If it does not, support must perform the revocation.
- Password change effect: Confirm whether a password change invalidates existing customer tokens in your version, and test this with a token from a test account.
- Support procedure: Define who may invalidate tokens, how the caller's identity is verified first, and where the action is logged.
- App behavior after revocation: Check how the app responds to a refused request so the shopper is asked to sign in again without losing the cart or other local state.
- Device storage: Ask how the app stores tokens on the device and whether those tokens are protected by the operating system's secure storage.
Check that a revoked customer token is refused on every API route the app uses, not only on the one you tested.
Integrations are granted through an integration record that carries resource permissions, a consumer key and access tokens. When an ERP vendor, PIM provider or agency ends its contract, the store owner and platform team should deactivate the integration, revoke its tokens and review the consumer key. The partner should also confirm in writing that it has removed its own copies of the credentials.
- Deactivate the integration: Turn the integration off so its credentials stop working, and do this before deleting anything so you can confirm the effect.
- Revoke access tokens: Revoke the tokens issued to the partner, and ask the partner to confirm that cached or stored copies are gone.
- Review the consumer key: Check whether any other system still references the key, and remove it once nothing depends on it.
- Review resource permissions: Record which resources the integration could read or write, and check for bulk exports or data pulls made by the partner.
- Obtain written confirmation: Ask the partner to confirm the date it stopped using the credentials and that it has deleted them.
Review the access log for calls made with the integration's credentials after the contract end date, and confirm with your partner how long their logs retain those calls.
Security controls that sit around token lifetimes
A token lifetime only limits damage if the controls around it work too. The cards below cover the settings that narrow who can obtain a token, where it can be used, and whether you can prove that a revoked token stopped working.
Admin two-factor authentication
Token lifetimes matter less when an attacker can log in as an admin in the first place. Confirm which two-factor options your Magento Open Source version supports for admin sign-in, and who can enroll or reset them. Check that a staff member's second factor is removed when their account is disabled, since a leftover device can keep an account reachable. The admin login path is the one to test first.
Magento source repositoryRestricting admin access by network
Where your environment allows it, limit the admin area to known networks, VPN ranges or a bastion host so that a stolen admin token cannot be used from anywhere. Confirm whether your web server or load balancer can enforce this for the admin path, and whether your support staff and remote contractors can still reach it. Test the rule from an address outside the allowed range before you rely on it.
Keeping the API off public exposure
If no mobile app, integration or front end needs the REST, SOAP or GraphQL endpoints from the internet, do not expose them there. Route API traffic through an internal network or an authenticated gateway, and confirm which paths your install serves publicly. Review this list after each release, since new modules can add endpoints.
Rotating integration credentials
Integration access tokens for ERP, PIM and marketplace connectors often outlive the people who set them up. Set a rotation schedule for each integration, record its owner, and plan the change window so the connector can accept the new credential before the old one is revoked. Ask your vendor which token type each connector uses and whether it can rotate without manual edits.
Logging token creation and use
You cannot verify a revocation without records of when tokens were issued, by whom, and where they were used. Confirm which events your version writes to its logs, where they are stored, and how long they are kept. Forward them to a central log system, and test that a revoked token produces failed requests in the log, so the revocation is shown to work rather than assumed.
Patching the platform on schedule
Token and session behavior changes between releases, and security fixes often arrive as patches to supported lines. Adobe's lifecycle records set the end of regular support for each 2.4.x line, so check which line your store runs before planning token changes. Recheck your token settings after each patch, because a default can change with it.
- Latest release line
- 2.4.9
Why patch cadence and PCI scope shape the token policy
A token lifetime that works today can change behavior after a patch release, so the expiry and revocation settings you choose need a retest every time you upgrade. Adobe's upgrade guidance recommends upgrading every patch cycle to stay secure and PCI compliant. Each upgrade touches the code that issues, validates and expires tokens, and the effort it takes depends on your customizations, the number of extensions you run, your third-party integrations and your coding practices. A store with few extensions and no custom token handling will usually have a short test list. A store where a mobile app, an ERP connector and a custom front end all depend on the same admin or customer token will have a much longer one.
Build the test cycle around the release line you run. Adobe lists 2.4.8-p5 and 2.4.9 as released on May 12, 2026, and gives each 2.4.x release three years of standard support from general availability. End of regular support falls on May 31, 2027 for 2.4.7 and May 31, 2028 for 2.4.8. Check the Adobe Commerce lifecycle policy for your line before you set the cadence. For each upgrade, rerun these checks in a staging copy of your production configuration: token expiry for admin and customer accounts, revocation after an account is disabled, and refresh behavior for every integration. Record the results with the release version so the evidence is ready for your PCI DSS assessor, who will look for a documented, repeatable control rather than a one-time setting.
PCI DSS scope is the reason the token policy belongs in the compliance file, not only the admin settings. If tokens can reach cardholder data or the payment flow, the policy that limits their lifetime and revokes them after staff leave becomes part of your scoping evidence. Confirm with your assessor and your payment provider which systems and integrations fall in scope before you agree on a lifetime. Then ask your partner or internal team to show how each upgrade is tested against that agreed policy, and who signs off when a result changes.
Limits to confirm in your own environment
The lifetimes, revocation behavior and compliance fit for token settings depend on the exact 2.4.x version, your extensions and your distribution. The cards below list what to confirm, who to ask, and which test results will settle each point.
Default lifetimes and configuration paths
Default token lifetimes and the admin settings that change them can differ between 2.4.x releases, so the values in any plan must be read from the version you actually run. Confirm the exact default and the configuration path on your installed release, then record both in your hardening baseline. Ask the Adobe documentation for the release you deploy, and check the value in a staging copy of your own store before you rely on it.
- Latest release line
- 2.4.9
Revocation timing for each action
Revoking a token, deactivating an admin user and resetting a password may not take effect at the same moment. Some actions may stop the next request, while others may leave an existing session valid until it expires. Ask the vendor which revocation action is immediate and which waits for the next request, then test each one with a live token in staging and log the result.
Extension handling of token expiry
Third-party extensions that call the REST or GraphQL APIs, or that store their own session data, may not follow the core token rules. An integration may keep working after a core token expires, or fail in a way that hides the cause. Ask each extension vendor how it refreshes or re-requests tokens and whether it stores credentials, then include those extensions in your own test plan.
Behavior under Mage-OS and other distributions
Mage-OS and other community distributions are built on Magento Open Source but are maintained by different teams. Token defaults, configuration keys and security patch timing may differ from upstream. Confirm with the distribution's maintainers which defaults and patches they ship, and do not assume that the upstream values apply to a distribution build.
Mage-OS siteFit with your policy and PCI assessor
A lifetime that suits a mobile app may not meet your own access policy or the expectations of your PCI DSS assessor for administrative access. The assessor decides whether your controls satisfy the requirement, and DeployOpen does not issue that judgment. Ask your assessor to review the chosen values and the evidence you will show, such as configuration exports and revocation test logs.
Your own test results
Vendor documentation and third-party statements describe intent, while your environment shows actual behavior. Build a short test plan that measures expiry, revocation timing, failed-login handling and integration recovery on the exact 2.4.x build and extensions in production. Keep the results with the change record so that the next upgrade can be retested against the same cases.
Questions teams ask before hiring help with token lifetimes
How much effort does a token policy review take?
The effort depends on how many places in your store issue or accept tokens, so the size of the review follows the inventory. Admin and customer tokens are one part. The larger part is every API client that holds a token: mobile apps, ERP or PIM connectors, marketplace feeds and any custom front end. Each custom integration, extension that calls the API, and piece of checkout code that handles tokens adds review time. If your store falls in PCI DSS scope, reviewers also need to trace where tokens could expose payment data. Ask any partner for a written scope that lists the clients, integrations and extensions it will review before quoting.
Can our own team set token lifetimes without a partner?
Yes, if your team has an administrator who knows the Magento Open Source configuration and an engineer who can read the integration code. Lifetime settings are part of the store configuration, so the change itself is small. The harder work is deciding the values for each client type, testing that mobile sessions still behave well, and confirming that integrations refresh or reauthenticate correctly before a lifetime is shortened. Teams that lack staff time to run that testing often bring in a partner for the review and leave the routine changes in-house afterward.
How long does testing a new token policy take?
Testing length is driven by how many clients must be checked and how often each one runs. A policy change needs a staging store that mirrors production configuration, a test pass for each client type, and a rollback plan if a connector fails at a lifetime boundary. Scheduled jobs, such as nightly ERP syncs, need a run that crosses the new expiry point so the failure shows up before production. Ask any partner to show its test plan and which client types it will cover, then compare that plan against your own release calendar and change-control rules.
What do we need to provide for a token review?
A partner needs three things from your side. The first is a system inventory: every API client, integration record, extension that touches the API, and the people or services that hold tokens. The second is named process owners in identity and HR, because revocation depends on knowing who joined, moved or left. The third is a staging store that matches production closely enough to test lifetimes and reauthentication. Without these, the review spends its time rediscovering the environment. Confirm the access your partner needs to the staging store and the inventory format before the work starts.
How does token revocation fit into staff offboarding?
Revocation should be a step in your offboarding workflow, not a manual task someone remembers later. When an administrator or staff member leaves, their admin session and any integration tokens they created or hold must be invalidated, and the change should be recorded. Your identity provider or HR system should trigger that step, and the people who own those processes must agree on the owner, the deadline and the evidence kept. Test the revocation path on staging with a dummy account so you know what happens to running jobs before you rely on it in production.
What should a partner deliver at the end of the work?
A well-scoped engagement should end with written deliverables your team can keep and run. Typically that means a documented token policy with lifetimes per client type, the reasoning behind each value, the configuration changes applied in staging and production, a test record covering mobile sessions, integrations and scheduled jobs, and a revocation procedure tied to offboarding. Ask whether the partner also provides evidence your security or compliance team can review, and whether a retest is included after your first configuration change. Agree on these items in writing before work starts.
Does a shorter token lifetime always improve security?
Not automatically. Shorter lifetimes reduce the time a stolen token stays useful, but they also cause more forced reauthentication, which can break mobile apps and unattended integrations that cannot prompt a person. The right value depends on which clients are human-driven and which run unattended, and on whether each one can refresh safely. Admin sessions usually justify tighter limits than integration tokens, while integrations often need a separate credential model with its own rotation schedule. Review the trade-off per client rather than applying one value everywhere.
How DeployOpen scopes and delivers token lifetime work
DeployOpen treats Magento Open Source customer and admin token lifetimes as a planned security control, not a setting to change at the last minute. We scope the token policy for each client type, build and test it in your own infrastructure, and hand over the configuration and runbooks your team needs to operate it.
How we scope
- Inventory every consumer of customer, admin and integration tokens, including mobile apps, ERP connectors and internal scripts.
- Agree token lifetime targets per client type in a written scope before any configuration changes begin.
- Define who revokes tokens when staff leave and which system of record triggers that revocation.
How we build
- Configure admin and customer token lifetimes in the store and document each value and its reason.
- Test expiry, refresh and revocation behavior against each client, including the mobile app and integration paths.
- Verify two-factor requirements and admin session settings alongside token lifetimes so the controls work together.
How we hand over
- Deliver a written configuration record listing every lifetime value, its owner and its review date.
- Provide an offboarding runbook that covers token revocation steps for departing administrators and retired integrations.
- Walk your operations and security teams through the tests so they can repeat revocation checks after changes.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer, including re-checks after Magento patch releases.
- Ask for a quote built from the written scope, since DeployOpen does not publish a price list.

