Set up shopper authentication

Shopper authentication lets a shopper sign in to their Adobe Commerce account from an AI agent, so the agent can send requests to the Shopper MCP Server as the signed-in shopper.

Adobe Commerce acts as the OAuth 2.0 authorization server. The shopper always signs in on your storefront, so the agent never sees the shopper’s password:

  1. The agent sends the shopper to your storefront sign-in page.
  2. The shopper signs in, or creates an account.
  3. Adobe Commerce returns a one-time authorization code to the agent.
  4. The agent exchanges the code for an access token and a refresh token.
  5. Shopper MCP Server calls the Adobe Commerce GraphQL API with the access token. The token can call only the GraphQL operations covered by its scopes.

The flow uses the OAuth 2.0 authorization code grant with PKCE (Proof Key for Code Exchange). Product discovery does not require shopper authentication.

NOTE
On Adobe Commerce Optimizer, shoppers sign in on your own OAuth 2.0 authorization server, and only your custom tools receive the shopper’s token. See Set up shopper authentication for Adobe Commerce Optimizer and, for agent builders, Set up an AI agent for shopper authentication.

Before you begin before-you-begin

Step 1: Register an OAuth 2.0 client register-client

An OAuth 2.0 client identifies the application that requests access for the shopper.

  1. In the Commerce Admin, go to System > Agentic Commerce > OAuth 2.0 Clients.

  2. Click New Client.

  3. Enter a Name. New clients are active.

  4. In Redirect URIs, enter one URI per line. The redirect URI of each request must match one of these values exactly.

    Each URI must be absolute and have no fragment (#). Use https, http on localhost, 127.0.0.1, or [::1] for local testing, or a private-use scheme such as com.example.app: for native apps.

  5. In Allowed Scopes, select the scopes that the client can request. See Scopes.

  6. Click Save Client.

    OAuth 2.0 client form {width="500" modal="regular"}

  7. Copy the Client ID and the client secret from the confirmation message.

WARNING
The client secret is shown only once. Store it in a secrets manager. Never put it in storefront code, MCP request headers, or source control.
IMPORTANT
Shoppers are not asked to approve the client on a consent screen when they sign in through a headless storefront. Registering a client approves it for every shopper who signs in. Register only clients that you trust, and grant only the scopes they need.

Scopes scopes

Scope
Allows the agent to
cart_read
Read the shopper’s cart
cart_write
Add, update, and remove cart items, and check out
customer_orders_read
Read the shopper’s orders
customer_profile_read
Read the shopper’s account information
customer_profile_write
Update the shopper’s account information
customer_addresses_read
Read the shopper’s addresses
customer_addresses_write
Add, update, and delete the shopper’s addresses
wishlist_read
Read the shopper’s wish list

An access token can call only the GraphQL operations bound to its scopes. Every other operation is refused with a graphql-authorization error. Catalog, store, and CMS queries do not need a scope.

Step 2: Configure the storefront settings storefront-settings

Shopper MCP Server receives the storefront URL and the policy URLs for each store view. Commerce uses the sign-in URL to send shoppers to the right sign-in page.

  1. In the Commerce Admin, go to Stores > Settings > Configuration > Adobe Services > Shopper MCP.

  2. Select the store view in the Scope selector.

  3. Expand the Storefront section and review the values. Empty fields show a suggested value.

    table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2
    Field Description
    Storefront URL Home page of the storefront where shoppers continue their cart.
    Sign-in URL Storefront page where shoppers sign in to link their account with an AI agent. See Step 3. [PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."} The suggested value is the native login page (customer/account/login), or customer/login when the Fastly CDN module is configured with a service ID and API token and the Fastly service routes to Edge Delivery Services.
    Privacy Policy URL Privacy policy page of the storefront.
    Terms of Service URL Terms of service page of the storefront.

    All values must be absolute https URLs.

    Shopper MCP storefront settings {width="500" modal="regular"}

  4. Click Save Config.

    Until you save, the storefront URL and the sign-in URL use the suggested values. The privacy policy and terms of service URLs are published only after you save.

Step 3: Prepare the sign-in page sign-in-page

The sign-in page is where the agent sends the shopper. The page receives the OAuth 2.0 request parameters (response_type, client_id, redirect_uri, scope, state, code_challenge, code_challenge_method) in its query string.

Follow the guide for your storefront:

Route the OAuth 2.0 paths in Fastly fastly

[PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."}

You can set the authorization server’s issuer in Stores > Configuration > Adobe Services > OAuth2 > Issuer. If you leave the field blank, the server uses the store view’s secure base URL.

If Fastly serves both your Edge Delivery Services storefront and Adobe Commerce on the same domain, configure Fastly to route requests for the following paths to Adobe Commerce:

  • /oauth2ac/*: authorization endpoint
  • /rest/V1/oauth2ac/*: token, revocation, and introspection endpoints
  • /.well-known/oauth-authorization-server: authorization server metadata
  • /.well-known/oauth2ac/jwks: signing keys

If Adobe Commerce runs on a different domain than the storefront, set Issuer to the storefront domain and route the same paths from the storefront CDN to Adobe Commerce. The metadata builds every endpoint from the issuer.

Keep the cache headers that Adobe Commerce sends: token responses are not cacheable, and the metadata and signing keys are cacheable for a short time.

Step 4: Activate Shopper MCP activate

Activation registers your store with the Shopper MCP Server, so that AI agents can find your storefronts and sign in your shoppers.

  1. In the Commerce Admin, go to System > Agentic Commerce > Shopper MCP.

  2. Click Activate.

    Status changes to Active, and Last published shows the date and time of activation. The Registry entry lists the published endpoints and store views.

    Shopper MCP page {width="500" modal="regular"}

To apply updates after you add or change store views or change the storefront settings, click Republish.

To deactivate the Shopper MCP, click Deactivate. Deactivating does not remove your store from the registry.

The Commerce Services Connector environment determines the registry: production keys publish to production, and sandbox keys publish to sandbox.

Step 5: Verify the setup verify

  1. Open the authorization server metadata and confirm that it returns 200 with your issuer, endpoints, and scopes:

    table 0-row-2 1-row-2 2-row-2
    Deployment Metadata URL
    Adobe Commerce on cloud infrastructure or on-premises [PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."} https://<store-domain>/.well-known/oauth-authorization-server
    Adobe Commerce as a Cloud Service [SaaS only]{class="badge positive" title="Applies to Adobe Commerce as a Cloud Service projects only (Adobe-managed SaaS infrastructure)."} https://<tenant-base-url>/public/oauth2ac/metadata
  2. Confirm that the Shopper MCP page shows Active.

  3. In a non-production environment, connect an AI agent, ask it to show your cart, and sign in when it sends you to the storefront. Confirm that the agent then returns your cart.

The metadata lists the token, revocation, and introspection endpoints, the signing keys (JWKS), and the supported client authentication methods (client_secret_basic, client_secret_post).

Next step next-step

Connect to Shopper MCP Server

recommendation-more-help
commerce-help-shopper-mcp