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_token function in auth/custom/__init__.

  • For the frontend, you need to provide the token by editing globalThis.getAuth under static/js/auth.js so that it returns the token and provider that you will validate with the validate_token function on the backend:

    globalThis.getAuth = async function () {
      return {
         token: "test-token",  // TODO: implement
         provider: "custom",
      };
    };
    

    Other integrations: provide the token via the auth config, see your specific integration for more details: VBA, Google Apps Script, or Office Scripts.