Documentation You are here: start » v » 2.0 » customer_portal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:customer_portal [2025/04/21 13:32] – [BETA Setup Instructions] adamv:2.0:customer_portal [2025/06/25 15:23] (current) – [Incorporating the Customer Portal SSO with an Existing SSO Endpoint] adam
Line 4: Line 4:
  
  
-==== Beta Instructions ====+==== Enabling the portal ==== 
 + 
 +The customer portal can be enabled from the Foxy admin at [[https://admin.foxy.io|admin.foxy.io]]. Navigate to the Settings > Customer Portal section where you can configure the portal for your store. 
 + 
 +You need to specify an allowlist of domains where the portal is able to be utilised. Note that all domains have to begin with ''%%https://%%'', and when adding a primary domain, we recommend adding both the domain with and without the ''www.'' subdomain (for example, ''%%https://mydomain.com%%'' and ''%%https://www.mydomain.com%%''). If you're adding a subdomain already (like ''%%https://customer.mydomain.com%%'') then that doesn't need a ''www.'' prefixed version. 
 + 
 +You can also configure additional options for the portal: 
 + 
 +  * SSO (single sign-on) - enable this option if you want to allow customers who are logged in to the portal to be automatically logged in to your website (requires some additional configuration, see that below) 
 +  * Customer registration - enable this option to allow customers to create a new account directly on the login form, as opposed to completing a purchase through the checkout 
 +  * Frequency changes for subscriptions - enabling this option allows customer to changes the frequency of their subscriptions. You can define rules for what options a customer can change a subscription too, depending what subscription it is. 
 +  * Next payment date changes for subscriptions - if enabled, customers will be able to modify the next date of their subscription. This can be limited based on rules to restrict how far or to what days a customer can change the next date to. 
 +  * Session lifespan - allows you to define how long a customer can remain logged in to the portal for before being automatically logged out 
 +  * JWT shared secret - this secret is used to sign the tokens returned as part of authenticating with the portal. Changing this secret will invalidate any active authenticated sessions on the customer portal. Unless you have specific needs here, you can let this value be set automatically. 
 + 
 +==== Setup Instructions ====
  
 You can [[http://foxy.io/examples/customer-portal-demo|see an example of our customer portal element on our website here]]. You can [[http://foxy.io/examples/customer-portal-demo|see an example of our customer portal element on our website here]].
Line 233: Line 248:
 If you've already got SSO enabled and configured on your Foxy store, you'll need to handle things separately. We can't give step-by-step instructions, as there are countless ways to handle SSO, but here are the general ideas: If you've already got SSO enabled and configured on your Foxy store, you'll need to handle things separately. We can't give step-by-step instructions, as there are countless ways to handle SSO, but here are the general ideas:
  
-  * **Create the customer portal session + cookie when a customer logs in.** So when a customer enters their username and password, you can make a quick ''POST /s/customer/authenticate'' request with their entered username + password. Set the ''fx.customer'' cookie with the value you receive. Note that this approach requires the Foxy password to be synced with your own auth system.+  * **Create the customer portal session + cookie when a customer logs in.** So when a customer enters their username and password, you can make a quick ''POST /s/customer/authenticate'' request as documented below with their entered username + password. Set a localstorage item named ''session'' with a stringified version of the JSON from the successful response. Note that this approach requires the Foxy password to be synced with your own auth system.
   * **If you don't have access to the customer's password...** You can use your store's configured [[.:unified_order_entry|UOE password]] password. (This should //only ever// be serverside, as you should never share that password in the browser.)   * **If you don't have access to the customer's password...** You can use your store's configured [[.:unified_order_entry|UOE password]] password. (This should //only ever// be serverside, as you should never share that password in the browser.)
   * Unlike the checkout, you likely would not want to allow login to the portal if the customer's not already logged into your system. Instead, redirect the customer to your login page so they'll be fully logged in (instead of logged into the Foxy customer portal, but not to your system or the checkout).   * Unlike the checkout, you likely would not want to allow login to the portal if the customer's not already logged into your system. Instead, redirect the customer to your login page so they'll be fully logged in (instead of logged into the Foxy customer portal, but not to your system or the checkout).

Site Tools