Auth Server

Get familiar with the ZKsync SSO auth server.

The Auth Server is a static web page that acts as a central manager of the account creation and authentication process.

Because passkeys are only valid for a specific HTTPS domain, they are registered to auth server's domain. This allows users to reuse their SSO account on any other domain.

You can think of this like logging into Google, and using your Google account to create an account on a 3rd party website. You are able to sign in and logout of both ZKsync SSO, as well as each individual app that is integrated with it.

zksyncSsoConnector

To connect to the Auth Server through the SDK, you can use the zksyncSsoConnector method.

const ssoConnector = zksyncSsoConnector({
// ...options
});

const wagmiConfig = defaultWagmiConfig({
  connectors: [ssoConnector],
  // ...configValues
});

ZksyncSsoConnectorOptions Interface

The configurable options for zksyncSsoConnector include the session config, basic app information (name, icon), and Auth Server URL. The fully expanded type looks like:

/**
  * @member metadata - Defaults to page title and website favicon
  * @member session - Session configuration preferences
  * @member authServerUrl - URL of the Auth Server
  */
type ZksyncSsoConnectorOptions = {
  metadata?: {
    name: string,
    icon?: string,
  },
  session?: SessionPreferences,
  authServerUrl?: string;
};

This returns a WAGMI connector that can be used to perform wallet-like actions with the available account. All of the functionality is then exposed via WAGMI, making the ZKsync SSO account nearly indistinguishable from any other standard wallet provider.

User Dashboard

ZKsync SSO provides a dashboard where users can conveniently manage their accounts through a web interface.

This dashboard offers several key features:

  • View their asset balances across all the ZK Chains.
  • Add or remove passkeys or devices.
  • Configure account recovery options.
  • View all active sessions connected to their account and terminate unwanted sessions.
  • View their transaction history.

Made with ❤️ by the ZKsync Community