Other Auth Providers¶
In addition to Microsoft Entra ID (SSO), xlwings Server supports various authentication providers, including custom ones, which are described here.
Custom Authentication¶
To use your own authentication method, run the following command:
uv run xlwings-server add auth custom
This will add auth/custom/__init__ and static/js/auth.js. The command also activates the custom authentication provider in the .env file:
XLWINGS_AUTH_PROVIDERS=["custom"]
For the backend, implement the
validate_tokenfunction inauth/custom/__init__.For the frontend, you need to provide the token by editing
globalThis.getAuthunderstatic/js/auth.jsso that it returns thetokenandproviderthat you will validate with thevalidate_tokenfunction on the backend:globalThis.getAuth = async function () { return { token: "test-token", // TODO: implement provider: "custom", }; };
Other integrations: provide the token via the
authconfig, see your specific integration for more details: VBA, Google Apps Script, or Office Scripts.