Complete configuration for the Portal Web SDK by enabling it to run on a subdomain of your application.
CNAME
record to web.portalhq.io
in your DNS provider:
CNAME
portal
(or any value you’d like to use for the subdomain) This will create a subdomain like portal.yourdomain.com
.web.portalhq.io
portal.
as the name of the subdomain on your application. So if your application is at yourdomain.com
we recommend configuring portal.yourdomain.com
. If your application is at app.yourdomain.com
the we recommend configuring portal.app.yourdomain.com
.
ClientSessionToken
which is used to authenticate a user to the Portal backend.
Cookies are configured with the security flags http-only
and secure
to ensure cookies are only transmitted over secure connections (TLS) and are inaccessible by javascript.
Cookies are assigned to the subdomain, which means they are not included on requests to your application, and only on requests to Portal’s backend.
LocalStorage
The Web SDK leverages LocalStorage to store the user’s signing share which is used during MPC operations to sign messages and transactions.
Values stored in LocalStorage are scoped to the subdomain which means they cannot be accessed by the DOM of your application. This is a helpful level of isolation that protects the MPC share from any XSS bugs or malicious javascript on your web application.