Skip to content

Commit c33fd99

Browse files
Merge branch 'master' into android-playground-guide
2 parents 1ddc50d + 1e416a6 commit c33fd99

10 files changed

Lines changed: 598 additions & 126 deletions

File tree

docs/auth-provider-setup/aggregate-verifier.mdx

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,58 @@ description: "Creating Aggregate Verifier on the Web3Auth Dashboard | Documentat
66
image: "images/docs-meta-cards/documentation-card.png"
77
---
88

9-
Developers can create `Aggregate Multiple Provider` from the Web3Auth Dashboard by combining multiple login methods to create a verifier to get the
10-
same address for their user regardless of their login providers. For example, combining a `Google` and `Email Passwordless` login or `Google` and
11-
`GitHub` via Auth0 to access the same address for your user. These login methods should share the same Verifier ID, e.g., `email`; Such verifiers are
12-
called `Single ID Verifiers`.
9+
Developers can create `Aggregate Multiple Provider` from the Web3Auth Dashboard by combining
10+
multiple login methods to create a verifier to get the same address for their user regardless of
11+
their login providers. For example, combining a `Google` and `Email Passwordless` login or `Google`
12+
and `GitHub` via Auth0 to access the same address for your user. These login methods should share
13+
the same Verifier ID, e.g., `email`; Such verifiers are called `Single ID Verifiers`.
14+
15+
:::note MINIMUM GROWTH PLAN REQUIRED
16+
17+
Access to creating a verifier is gated, hence creating an aggregate verifier requires a minimum
18+
[Growth Plan](https://web3auth.io/pricing.html). You can use this feature for projects on
19+
`sapphire_devnet` for free.
20+
21+
:::
1322

1423
### Set up an Aggregate Verifier
1524

16-
1. Create an aggregate verifier for your application by selecting `Aggregate Multiple Providers` as the Login provider from the login providers.
25+
1. Create an aggregate verifier for your application by selecting `Aggregate Multiple Providers` as
26+
the Login provider from the login providers.
1727
![Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate.png)
1828
2. Click on `Add Sub Verifiers` to add a new sub-verifier.
1929
![Add first sub-verifier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-add-sub.png)
20-
3. Select any social login provider from the list to start with. Here we're selecting `Google`. Paste the **Client ID** from the Google App to the
21-
`Client ID` field and click on `Add Sub Verifiers`.
30+
3. Select any social login provider from the list to start with. Here we're selecting `Google`.
31+
Paste the **Client ID** from the Google App to the `Client ID` field and click on
32+
`Add Sub Verifiers`.
2233
![Select Google from Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-google.png)
2334
4. Next, create the second sub-verifier. Click on `Add Sub Verifiers` to add a new sub-verifier.
24-
5. Select `Auth0` on the dropdown or choose `Custom Providers` from the radio buttons. We're selecting `Auth0` in this example.
35+
5. Select `Auth0` on the dropdown or choose `Custom Providers` from the radio buttons. We're
36+
selecting `Auth0` in this example.
2537
![Auth0 as sub verifier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-add-second-sub.png)
26-
6. Select the `Authentication Type` based on your application need on the dropdown. We're selecting `GitHub` in this example.
38+
6. Select the `Authentication Type` based on your application need on the dropdown. We're selecting
39+
`GitHub` in this example.
2740
![Create Aggregate Verifiier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-auth0-github.png)
28-
7. Select `Email` as the **JWT Verifier ID** and enter the `Auth0 Client ID` and `Auth0 Domain` from your Auth0 application. See how to create a new
29-
Auth0 application [here](https://auth0.com/docs/quickstart/webapp/).
41+
7. Select `Email` as the **JWT Verifier ID** and enter the `Auth0 Client ID` and `Auth0 Domain` from
42+
your Auth0 application. See how to create a new Auth0 application
43+
[here](https://auth0.com/docs/quickstart/webapp/).
3044

3145
![Create GitHub Sub Verifiier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-auth0-github-filled.png)
3246
![Domain and Client ID from Auth0 Dashboard](/dashboard/verifiers/aggregate-verifier/av-a0-github.png)
3347

3448
:::info NOTE
3549

36-
1. Add the [GitHub Social Connection](https://marketplace.auth0.com/integrations/github-social-connection) to your Auth0 application.
37-
2. One has to request an email from the user while setting up the GitHub Social Connection on the Auth0 Dashboard.
50+
1. Add the
51+
[GitHub Social Connection](https://marketplace.auth0.com/integrations/github-social-connection)
52+
to your Auth0 application.
53+
2. One has to request an email from the user while setting up the GitHub Social Connection on the
54+
Auth0 Dashboard.
3855
![Request Email address for GitHub Social connection](/dashboard/verifiers/aggregate-verifier/av-a0-github-email.png)
3956

4057
:::
4158

42-
8. Similarly, create a third sub-verifier for `Email Passwordless` via Auth0. Follow the above steps from 5 to 8, and select `Email Passwordless` in
43-
place of `GitHub`.
59+
8. Similarly, create a third sub-verifier for `Email Passwordless` via Auth0. Follow the above steps
60+
from 5 to 8, and select `Email Passwordless` in place of `GitHub`.
4461
![Create Email Passwordless Sub Verifiier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-auth0-email-passwordless-filled.png)
4562
9. Finally, click on `Create` to deploy the verifier.
4663

@@ -57,7 +74,8 @@ import { Web3AuthNoModal } from "@web3auth/no-modal";
5774
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
5875
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
5976

60-
const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
77+
const clientId =
78+
"BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
6179
// get it from https://dashboard.web3auth.io by creating a Plug n Play project.
6280

6381
const chainConfig = {

docs/auth-provider-setup/byo-jwt-provider.mdx

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,30 @@ description: "Bring your own custom JWT Provider | Documentation - Web3Auth"
55
image: "images/docs-meta-cards/documentation-card.png"
66
---
77

8-
You can incorporate your login providers by utilizing one of the custom login schemes, including RSA or ECDSA signatures. By doing so, your users can
9-
continue using your current login providers or your custom authentication scheme.
8+
You can incorporate your login providers by utilizing one of the custom login schemes, including RSA
9+
or ECDSA signatures. By doing so, your users can continue using your current login providers or your
10+
custom authentication scheme.
11+
12+
:::note Minimum Growth plan required
13+
14+
Access to Custom Authentication with your own custom JWT Provider is gated. The minimum
15+
[pricing plan](https://web3auth.io/pricing.html) to create custom
16+
[verifiers](/auth-provider-setup/verifiers) is the **Growth Plan**. However, you can use this
17+
feature for projects on `sapphire_devnet` for free.
18+
19+
:::
1020

1121
:::info
1222

13-
Custom JWT authentication is only supported with [`Web3Auth Plug and Play No Modal SDK`](/sdk/pnp/web/no-modal/) since the Web3Auth PnP Modal SDK will
14-
only help you configure the social logins within the Modal UI.
23+
Custom JWT authentication is only supported with
24+
[`Web3Auth Plug and Play No Modal SDK`](/sdk/pnp/web/no-modal/) since the Web3Auth PnP Modal SDK
25+
will only help you configure the social logins within the Modal UI.
1526

1627
:::
1728

18-
For signing the JWT, your application must follow the JWT specification and use the private key corresponding to the JWKS. And the public keys of the
19-
JWT should be exposed through an endpoint, which is used by Web3Auth to verify the JWT.
29+
For signing the JWT, your application must follow the JWT specification and use the private key
30+
corresponding to the JWKS. And the public keys of the JWT should be exposed through an endpoint,
31+
which is used by Web3Auth to verify the JWT.
2032

2133
:::warning Facing issue with JWT?
2234

@@ -30,8 +42,9 @@ Check out [**this troubleshooting page to fix those.**](/troubleshooting/jwt-err
3042

3143
To create a custom verifier for your JWT Providers, you'll need
3244

33-
1. **JWT Verifier ID**: JWT Verifier ID is the unique identifier to publicly represent a user on a verifier. e.g: `sub`, `email`, or even a custom
34-
field of your JWT payload that is unique in your system for each user.
45+
1. **JWT Verifier ID**: JWT Verifier ID is the unique identifier to publicly represent a user on a
46+
verifier. e.g: `sub`, `email`, or even a custom field of your JWT payload that is unique in your
47+
system for each user.
3548

3649
2. **JWK Endpoint**: An endpoint containing the JWKS used for signing the JWT.
3750

@@ -60,24 +73,26 @@ To create a custom verifier for your JWT Providers, you'll need
6073

6174
:::
6275

63-
You can add up to 3 validation fields, including any claims like `aud`, `sub`, `iss`, `email_verified` etc. These are the claims against which a
64-
JWT is validated.
76+
You can add up to 3 validation fields, including any claims like `aud`, `sub`, `iss`,
77+
`email_verified` etc. These are the claims against which a JWT is validated.
6578

6679
Here are a couple of examples to be used in validation:
6780

68-
- Token Audience ( `aud` ): The "aud" (audience) claim identifies the recipients for which the JWT is intended. Each principal intended to process
69-
the JWT MUST identify itself with a value in the audience claim. If the principal processing the claim does not identify itself with a value in
70-
the "aud" claim when this claim is present, then the JWT will be rejected. The `aud` value is a case-sensitive string containing a StringOrURI
71-
value. The interpretation of audience values is generally application-specific.
81+
- Token Audience ( `aud` ): The "aud" (audience) claim identifies the recipients for which the
82+
JWT is intended. Each principal intended to process the JWT MUST identify itself with a value
83+
in the audience claim. If the principal processing the claim does not identify itself with a
84+
value in the "aud" claim when this claim is present, then the JWT will be rejected. The `aud`
85+
value is a case-sensitive string containing a StringOrURI value. The interpretation of audience
86+
values is generally application-specific.
7287

73-
- Token Issuer ( `iss` ): The issuing authority of the token. The `iss` value is a case-sensitive string containing a StringOrURI value. Use of
74-
this claim is OPTIONAL.
88+
- Token Issuer ( `iss` ): The issuing authority of the token. The `iss` value is a case-sensitive
89+
string containing a StringOrURI value. Use of this claim is OPTIONAL.
7590

76-
- Token Subject ( `sub` ): The subject of the token. The `sub` value is a case-sensitive string containing a StringOrURI value. Use of this claim
77-
is OPTIONAL.
91+
- Token Subject ( `sub` ): The subject of the token. The `sub` value is a case-sensitive string
92+
containing a StringOrURI value. Use of this claim is OPTIONAL.
7893

79-
- Token Email Verified ( `email_verified` ): The email verified claim is a boolean value that indicates whether the email address has been
80-
verified.
94+
- Token Email Verified ( `email_verified` ): The email verified claim is a boolean value that
95+
indicates whether the email address has been verified.
8196

8297
## Using `jsonwebtoken` to generate JWT
8398

@@ -184,7 +199,8 @@ console.log(token);
184199

185200
</Tabs>
186201

187-
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data on the Web3Auth Dashboard.
202+
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data
203+
on the Web3Auth Dashboard.
188204

189205
### Login with JWT (idToken - jsonwebtoken)
190206

@@ -269,7 +285,8 @@ console.log(protectedHeader);
269285
console.log(payload);
270286
```
271287

272-
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data on the Web3Auth Dashboard.
288+
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data
289+
on the Web3Auth Dashboard.
273290

274291
### Login with JWT (idToken - jose)
275292

@@ -321,8 +338,9 @@ await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
321338

322339
`jwks-rsa - Passport Example`
323340

324-
The `jwks-rsa` library provides a small helper that makes it easy to configure `passport-jwt` with the `RS256` algorithm. Using `passportJwtSecret`
325-
you can generate a secret provider that will provide the right signing key to `passport-jwt` based on the `kid` in the JWT header.
341+
The `jwks-rsa` library provides a small helper that makes it easy to configure `passport-jwt` with
342+
the `RS256` algorithm. Using `passportJwtSecret` you can generate a secret provider that will
343+
provide the right signing key to `passport-jwt` based on the `kid` in the JWT header.
326344

327345
```tsx
328346
// Step 1. npm init -y && npm install passport-jwt
@@ -359,7 +377,8 @@ passport.use(
359377
app.use(passport.initialize());
360378
```
361379

362-
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data on the Web3Auth Dashboard.
380+
See [this](#filled-custom-jwt-verifier) to set up the custom jwt verifier using the above JWT data
381+
on the Web3Auth Dashboard.
363382

364383
### Login with JWT (idToken - passport-jwt)
365384

@@ -417,12 +436,14 @@ await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
417436

418437
## What are JWKS?
419438

420-
JWKS stands for JSON Web Key Set. It is a set of keys containing the public keys that should be used to verify any JSON Web Token (JWT) issued by the
421-
authorization server and signed using the RS256 signing algorithm.
439+
JWKS stands for JSON Web Key Set. It is a set of keys containing the public keys that should be used
440+
to verify any JSON Web Token (JWT) issued by the authorization server and signed using the RS256
441+
signing algorithm.
422442

423443
### How to create JWKS?
424444

425-
- Most of the login providers that support JWT-based login will provide you this URL, such as Firebase, Google, Auth0, AWS Cognito etc.
445+
- Most of the login providers that support JWT-based login will provide you this URL, such as
446+
Firebase, Google, Auth0, AWS Cognito etc.
426447

427448
- Firebase: `https://www.googleapis.com/service_accounts/v1/jwk/{your-project-id}`
428449
- Auth0: `https://{your-domain}/.well-known/jwks.json`
@@ -433,7 +454,8 @@ authorization server and signed using the RS256 signing algorithm.
433454

434455
### How to convert PEM to JWKS?
435456

436-
If you're using `jose` or `jsonwebtoken` library, you can use the following steps to convert your PEM file to JWKS.
457+
If you're using `jose` or `jsonwebtoken` library, you can use the following steps to convert your
458+
PEM file to JWKS.
437459

438460
1. Create a Private Key using openssl.
439461

@@ -464,6 +486,8 @@ If you're using `jose` or `jsonwebtoken` library, you can use the following step
464486

465487
![JWKS Convert Tool](https://web3auth.io/community/uploads/default/optimized/2X/3/3e58a3b7378b9778b0b2d646ec2a3cf47c56ee5e_2_690x448.jpeg)
466488

467-
4. To complete the process, you need to save the output as a `.json` file, host it on your server, and make sure it's publicly accessible.
489+
4. To complete the process, you need to save the output as a `.json` file, host it on your server,
490+
and make sure it's publicly accessible.
468491

469-
This will give you the `JWKS Endpoint`, which is required when setting up a `Custom JWT Verifier` on the Web3Auth Dashboard.
492+
This will give you the `JWKS Endpoint`, which is required when setting up a `Custom JWT Verifier`
493+
on the Web3Auth Dashboard.

docs/dashboard-setup/setup-custom-authentication.mdx

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,44 @@ displayed_sidebar: resources
55
description: "Setup Custom Authentication | Documentation - Web3Auth"
66
---
77

8-
The Custom Authentication section of the Web3Auth dashboard is where you can create a new verifier. This verifier allows you to implement custom
9-
authentication within your application, providing additional security and flexibility for your users. By creating a Custom Authentication Verifier,
8+
The Custom Authentication section of the Web3Auth dashboard is where you can create a new verifier.
9+
This verifier allows you to implement custom authentication within your application, providing
10+
additional security and flexibility for your users. By creating a Custom Authentication Verifier,
1011
you can tailor your authentication process to the unique needs of your project and its users.
1112

13+
:::note Minimum Growth plan required
14+
15+
Access to Custom Authentication is gated. The minimum
16+
[pricing plan](https://web3auth.io/pricing.html) to create custom
17+
[verifiers](/auth-provider-setup/verifiers) is the **Growth Plan**. However, you can use this
18+
feature for projects on `sapphire_devnet` for free.
19+
20+
:::
21+
1222
But before understanding about custom authentication, let us see **What is a Verifier?**
1323

1424
#### What is a Verifier?
1525

16-
A verifier is a piece of information about the OAuth provider being used by the application, which is queried by web3auth auth network nodes from a
17-
smart contract deployed on the Ethereum blockchain to verify the JWT token.
26+
A verifier is a piece of information about the OAuth provider being used by the application, which
27+
is queried by web3auth auth network nodes from a smart contract deployed on the Ethereum blockchain
28+
to verify the JWT token.
1829

1930
There are two types of `Verifiers` at Web3Auth:
2031

21-
1. `Default Verifiers`: These are the verifiers associated with OAuth providers(Google, Facebook, Apple etc.) which are owned and managed by
22-
Web3Auth's account.
23-
2. `Custom Verifiers`: If you want to manage your OAuth providers(Google, Facebook, Apple etc.) yourself or to use some Federated Identity Providers
24-
like Auth0, Firebase, AWS Cognito, Okta etc., or even your Custom JWT Authentication, you'll need to create a verifier under a project on the
25-
Web3Auth's dashboard.
32+
1. `Default Verifiers`: These are the verifiers associated with OAuth providers(Google, Facebook,
33+
Apple etc.) which are owned and managed by Web3Auth's account.
34+
2. `Custom Verifiers`: If you want to manage your OAuth providers(Google, Facebook, Apple etc.)
35+
yourself or to use some Federated Identity Providers like Auth0, Firebase, AWS Cognito, Okta
36+
etc., or even your Custom JWT Authentication, you'll need to create a verifier under a project on
37+
the Web3Auth's dashboard.
2638

27-
For users to be able to log in using your custom authentication flow, you will need to use a Custom Verifier. The Wallet that is generated for each
28-
user is specific to a verifier. Verifier scripts determine the access structure to your users' wallets, and the set of Verifier scripts you choose
39+
For users to be able to log in using your custom authentication flow, you will need to use a Custom
40+
Verifier. The Wallet that is generated for each user is specific to a verifier. Verifier scripts
41+
determine the access structure to your users' wallets, and the set of Verifier scripts you choose
2942
will determine which logins your application will ultimately use.
3043

31-
You can read more about verifiers [in this GitHub discussion](https://github.com/orgs/Web3Auth/discussions/427#discussioncomment-3442052).
44+
You can read more about verifiers
45+
[in this GitHub discussion](https://github.com/orgs/Web3Auth/discussions/427#discussioncomment-3442052).
3246

3347
The `Custom Authentication` tab of a project looks something like this:
3448

@@ -46,7 +60,8 @@ To create a verifier, you need to input the following details:
4660

4761
### Verifier identifier
4862

49-
The identifier for your verifier. You'll need this while initializing the `Web3Auth`/`Web3AuthNoModal` SDK for setting up the custom authentication.
63+
The identifier for your verifier. You'll need this while initializing the
64+
`Web3Auth`/`Web3AuthNoModal` SDK for setting up the custom authentication.
5065

5166
### Choose a Login Provider
5267

@@ -65,4 +80,5 @@ The following is the list we have on our Dashboard:
6580
3. Aggregate Multiple Providers
6681
- [Aggregate Verifier](/auth-provider-setup/aggregate-verifier)
6782

68-
If something you're looking for is not available in the list, choose `Custom Provider` and provide the JWT details.
83+
If something you're looking for is not available in the list, choose `Custom Provider` and provide
84+
the JWT details.

0 commit comments

Comments
 (0)