-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04b2883
commit cce09e5
Showing
11 changed files
with
307 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
content/00.zksync-era/30.unique-features/30.zksync-sso/20.features.md
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
content/00.zksync-era/30.unique-features/30.zksync-sso/21.auth-server.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: Auth Server | ||
description: 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](https://auth-test.zksync.dev). | ||
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. | ||
|
||
```ts | ||
const ssoConnector = zksyncSsoConnector({ | ||
// ...options | ||
}); | ||
|
||
const wagmiConfig = defaultWagmiConfig({ | ||
connectors: [ssoConnector], | ||
// ...configValues | ||
}); | ||
``` | ||
|
||
<!-- // cspell: disable --> | ||
### `ZksyncSsoConnectorOptions` Interface | ||
<!-- // cspell: enable --> | ||
|
||
The configurable options for `zksyncSsoConnector` include the session config, basic app information (name, icon), and Auth Server URL. | ||
The fully expanded type looks like: | ||
|
||
<!-- // cspell: disable --> | ||
|
||
```ts | ||
/** | ||
* @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; | ||
}; | ||
``` | ||
<!-- // cspell: enable --> | ||
|
||
This returns a [WAGMI connector](https://wagmi.sh/core/api/connectors) 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](https://auth-test.zksync.dev/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. |
Oops, something went wrong.