Both sides previous revisionPrevious revisionNext revision | Previous revision |
v:2.0:customer_portal [2025/04/21 13:41] – [Beta Instructions] adam | v:2.0:customer_portal [2025/06/25 15:23] (current) – [Incorporating the Customer Portal SSO with an Existing SSO Endpoint] adam |
---|
==== Enabling the portal ==== | ==== Enabling the portal ==== |
| |
The customer portal can be enabled from the Foxy admin at https://admin.foxy.io. Navigate to the Settings > Customer Portal section where you can configure the portal for your store. | 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 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: | You can also configure additional options for the portal: |
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). |