Skip to content

Commit

Permalink
Merge branch 'master' into business-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbaz17 authored Nov 20, 2023
2 parents f09bddb + e30f6b4 commit 3900762
Show file tree
Hide file tree
Showing 240 changed files with 9,019 additions and 3,731 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
file-extension: .mdx
use-quiet-mode: yes
30 changes: 15 additions & 15 deletions docs/auth-provider-setup/aggregate-verifier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ such verifiers are called `Single ID Verifiers`.
`Client ID` field and click on `Add Sub Verifiers`.
![Select Google from Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-google.png)
4. Next, create the second sub-verifier. Click on `Add Sub Verifiers` to add a new sub-verifier.
5. Select `Auth0` from the dropdown or choose `Custom Providers` from the radio buttons. We're selecting `Auth0` in this example.
5. Select `Auth0` on the dropdown or choose `Custom Providers` from the radio buttons. We're selecting `Auth0` in this example.
![Auth0 as sub verifier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-add-second-sub.png)
6. Select the `Authentication Type` based on your application need from the dropdown. We're selecting `Github` in this example.
6. Select the `Authentication Type` based on your application need on the dropdown. We're selecting `Github` in this example.
![Create Aggregate Verifiier on Web3Auth Dashboard](/images/dashboard/create-verifier-aggregate-auth0-github.png)
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
Auth0 application [here](https://auth0.com/docs/quickstart/webapp/).
Expand Down Expand Up @@ -57,7 +57,7 @@ import { Web3AuthNoModal } from "@web3auth/no-modal";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const clientId = "YOUR_WEB3AUTH_CLIENT_ID";
const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
// get it from https://dashboard.web3auth.io by creating a Plug n Play project.

const chainConfig = {
Expand All @@ -83,24 +83,24 @@ const openloginAdapter = new OpenloginAdapter({
loginConfig: {
// Google login
google: {
verifier: "YOUR_AGGREGATE_VERIFIER_NAME", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "YOUR_FIRST_SUB_VERIFIER_NAME", // Pass the Sub-Verifier here. eg w3a-google
verifier: "aggregate-sapphire", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "w3a-google", // Pass the Sub-Verifier here. eg w3a-google
typeOfLogin: "google", // Pass the type of login provider.
clientId: "GOOGLE_CLIENT_ID", // Pass the Google `Client ID` here.
clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com", // Pass the Google `Client ID` here.
},
// GitHub Login via Auth0
github: {
verifier: "YOUR_AGGREGATE_VERIFIER_NAME", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "YOUR_SECOND_SUB_VERIFIER_NAME", // Pass the Sub-Verifier here. eg w3a-a0-github
verifier: "aggregate-sapphire", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "w3a-a0-github", // Pass the Sub-Verifier here. eg w3a-a0-github
typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: "AUTH0_CLIENT_ID", // Pass the Auth0 `Client ID` here.
clientId: "hiLqaop0amgzCC0AXo4w0rrG9abuJTdu", // Pass the Auth0 `Client ID` here.
},
// Email Password Login via Auth0
emailpasswordless: {
verifier: "YOUR_AGGREGATE_VERIFIER_NAME", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "YOUR_THIRD_SUB_VERIFIER_NAME", // Pass the Sub-Verifier here. eg w3a-a0-email-passwordless
verifier: "aggregate-sapphire", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "w3a-a0-email-passwordless", // Pass the Sub-Verifier here. eg w3a-a0-email-passwordless
typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: "AUTH0_CLIENT_ID", // Pass the `Client ID` of your Auth0 Application.
clientId: "QiEf8qZ9IoasbZsbHvjKZku4LdnRC1Ct", // Pass the `Client ID` of your Auth0 Application.
},
},
},
Expand All @@ -120,7 +120,7 @@ const web3authProvider = await web3auth.connectTo("openlogin", {
const web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "emailpasswordless",
extraLoginOptions: {
domain: "YOUR_AUTH0_DOMAIN", // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com
domain: "https://web3auth.au.auth0.com", // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com
// This corresponds to the field inside jwt which must be used to uniquely identify the user.
verifierIdField: "email", // This is mapped b/w google and github logins.
isVerifierIdCaseSensitive: false,
Expand All @@ -131,7 +131,7 @@ const web3authProvider = await web3auth.connectTo("openlogin", {
const web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "github",
extraLoginOptions: {
domain: "YOUR_AUTH0_DOMAIN", // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com
domain: "https://web3auth.au.auth0.com", // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com
// This corresponds to the field inside jwt which must be used to uniquely identify the user.
verifierIdField: "email", // This is mapped b/w google and github logins.
isVerifierIdCaseSensitive: false,
Expand All @@ -142,6 +142,6 @@ const web3authProvider = await web3auth.connectTo("openlogin", {
:::info Example app

Check out the
[**full example on Github**](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/custom-authentication/aggregate-verifiers/auth0-google-aggregate-react-no-modal-example).
[**full example on Github**](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples/auth0-google-aggregate-no-modal-example).

:::
5 changes: 0 additions & 5 deletions docs/auth-provider-setup/auth-provider-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ description: "Auth Provider Setup | Documentation - Web3Auth"
import BYOCustomJWTTiles from "@site/src/common/docs/_byo-custom-jwt-providers.mdx";
import FederatedTiles from "@site/src/common/docs/_federated-providers.mdx";
import SocialTiles from "@site/src/common/docs/_social-login-providers.mdx";
import SocialViaFederatedTiles from "@site/src/common/docs/_social-via-federated-providers.mdx";

Auth Provider setup refers to the capability of creating a verifier with Web3Auth. We recommend you set a verifier to use the Custom Authentication
feature of Web3Auth.
Expand All @@ -19,10 +18,6 @@ feature of Web3Auth.

<SocialTiles />

#### Social via Federated/Identity Providers

<SocialViaFederatedTiles />

### Federated / Identity Providers

<FederatedTiles />
Expand Down
34 changes: 29 additions & 5 deletions docs/auth-provider-setup/federated-identity-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: "Federated / Identity Providers | Documentation - Web3Auth"
image: "images/docs-meta-cards/documentation-card.png"
---

import SetupAWSCognitoVerifier from "@site/src/common/guides/_setup-aws-cognito-verifier.mdx";
import SetupFirebaseVerifier from "@site/src/common/guides/_setup-firebase-verifier.mdx";

Federated / Identity providers enable you to use some implicit and authorization code grants. You could also use social providers on top of Federated
/ Identity providers to select other Social providers (e.g.: Twitter, Apple, GitHub, LinkedIn, WeChat etc.) that are not natively supported by us.
Note: This will require you to register an app with the Federated / Identity Providers.
Expand All @@ -13,13 +16,11 @@ Note: This will require you to register an app with the Federated / Identity Pro

## Auth0

- [Using Custom Authentication with Auth0](/content-hub/guides/auth0)

### Set up Auth0 Verifier

1. Create a verifier for your Auth0 application by selecting `Auth0` as the Login provider from this modal.
![Auth0 - Login Providers list on Web3Auth Dashboard](/dashboard/verifiers/login-providers-list.png)
2. Select the `Authentication Type` based on your application need from the dropdown.
2. Select the `Authentication Type` based on your application need on the dropdown.
![Auth0 Authentication Type list on Web3Auth Dashboard](/dashboard/verifiers/auth0-authentication-type-list.png)
3. Enter the `Auth0 Client ID` and `Auth0 Domain` from your Auth0 application. See how to create a new Auth0 application
[here](https://auth0.com/docs/quickstart/webapp/).
Expand All @@ -29,10 +30,33 @@ Note: This will require you to register an app with the Federated / Identity Pro

4. Click on the `Create` button to create your Auth0 verifier.

:::info Guide

Check out the [**Auth0 guide**](/content-hub/guides/auth0) to learn more about how to set up the Auth0 verifier and use it with Web3Auth.

:::

## AWS Cognito

- [Using Custom Authentication with AWS Cognito](/content-hub/guides/cognito)
### Set up AWS Cognito Verifier

<SetupAWSCognitoVerifier />

:::info Guide

Check out the [** AWS Cognito guide**](/content-hub/guides/cognito) to learn more about how to set up the AWS Cognito verifier and use it with
Web3Auth.

:::

## Firebase

- [Using Custom Authentication with Firebase](/content-hub/guides/firebase)
### Setup Firebase Verifier

<SetupFirebaseVerifier />

:::info Guide

Check out the [**Firebase guide**](/content-hub/guides/firebase) to learn more about how to set up the Firebase verifier and use it with Web3Auth.

:::
11 changes: 9 additions & 2 deletions docs/auth-provider-setup/social-providers/apple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ displayed_sidebar: docs
description: "Apple Social Login with Web3Auth | Documentation - Web3Auth"
---

:::note

Apple login can be performed in various ways, depending on the use case. We have demonstrated this with Auth0, but this can be done with any other
Federated/JWT providers.

:::

## Set up [Apple](https://marketplace.auth0.com/integrations/apple-social-connection) via Auth0

1. Create a verifier for your Auth0 application by selecting `Auth0` as the Login provider from this modal.
![Apple - Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-auth0.png)
2. Select `Apple` as the **Authentication Type** based from the dropdown.
2. Select `Apple` as the **Authentication Type** based on the dropdown.
![Apple - Auth0 Authentication Type list on Web3Auth Dashboard](/images/dashboard/create-verifier-google.png)
3. Enter the `Auth0 Client ID` and `Auth0 Domain` from your Auth0 application. See how to create a new Auth0 application
[here](https://auth0.com/docs/quickstart/webapp/).
Expand All @@ -21,7 +28,7 @@ description: "Apple Social Login with Web3Auth | Documentation - Web3Auth"
4. Add the [Apple Social Connection](https://marketplace.auth0.com/integrations/apple-social-connection) to your Auth0 application.
5. Click on the `Create Verifier` button.

## Example
### Example

```tsx
import { Web3AuthNoModal } from "@web3auth/no-modal";
Expand Down
88 changes: 88 additions & 0 deletions docs/auth-provider-setup/social-providers/baidu.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: Baidu Login with Web3Auth
sidebar_label: Baidu
displayed_sidebar: docs
description: "Baidu Login with Web3Auth | Documentation - Web3Auth"
---

:::note

Baidu login can be performed in various ways, depending on the use case. We have demonstrated this with Auth0, but this can be done with any other
Federated/JWT providers.

:::

## Set up [Baidu](https://marketplace.auth0.com/integrations/baidu-social-connection) via Auth0

1. Create a verifier for your Auth0 application by selecting `Auth0` as the Login provider from this modal.
![Baidu - Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-auth0.png)
2. Select the `Other` as the **Authentication Type** based on the dropdown.
![Baidu - Auth0 Authentication Type list on Web3Auth Dashboard](/images/dashboard/create-verifier-google.png)
3. Enter the `Auth0 Client ID` and `Auth0 Domain` from your Auth0 application. See how to create a new Auth0 application
[here](https://auth0.com/docs/quickstart/webapp/).

![Baidu - Domain and Client ID from Auth0 Dashboard](/images/dashboard/create-verifier-auth0-filled-common.png)
![Baidu - Auth0 Client ID and Auth0 Domain on Web3Auth Dashboard](/images/dashboard/create-verifier-auth0-unfilled.png)

4. Add the [Baidu Social Connection](https://marketplace.auth0.com/integrations/baidu-social-connection) to your Auth0 application.
5. Click on the `Create` button to create `Baidu` Custom Authentication via Auth0 verifier.

### Example

```tsx
import { Web3AuthNoModal } from "@web3auth/no-modal";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
// get it from https://dashboard.web3auth.io by creating a project.

const chainConfig = {
chainNamespace: "eip155",
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
displayName: "Ethereum Mainnet",
blockExplorer: "https://goerli.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
};

const web3auth = new Web3Auth({
clientId,
chainConfig,
web3AuthNetwork: "sapphire_mainnet",
});

const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig },
});

const openloginAdapter = new OpenloginAdapter({
privateKeyProvider,
adapterSettings: {
uxMode: "redirect",
loginConfig: {
jwt: {
verifier: "w3a-auth0-uk-demo", // Pass the Verifier name here
typeOfLogin: "jwt", // Pass on the login provider of the verifier you've created
clientId: "OfDAVldBEGslU9wjiWyQ1LPWOWNnnzim", // Pass on the Auth0 `Client ID` here
},
},
},
});
web3auth.configureAdapter(openloginAdapter);
setWeb3auth(web3auth);

// Initialize
await web3auth.init();

// Login with Baidu
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
domain: "https://web3auth.uk.auth0.com", // Pass on the Auth0 `Domain` here
verifierIdField: "sub", // Pass on the field name of the `sub` field in the JWT
connection: "baidu", // Use this to skip Auth0 Modal for Baidu login
},
});
```
88 changes: 88 additions & 0 deletions docs/auth-provider-setup/social-providers/bitbucket.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: Bitbucket Login with Web3Auth
sidebar_label: Bitbucket
displayed_sidebar: docs
description: "Bitbucket Login with Web3Auth | Documentation - Web3Auth"
---

:::note

Bitbucket login can be performed in various ways, depending on the use case. We have demonstrated this with Auth0, but this can be done with any other
Federated/JWT providers.

:::

## Set up [Bitbucket](https://marketplace.auth0.com/integrations/bitbucket-social-connection) via Auth0

1. Create a verifier for your Auth0 application by selecting `Auth0` as the Login provider from this modal.
![Bitbucket - Login Providers list on Web3Auth Dashboard](/images/dashboard/create-verifier-auth0.png)
2. Select the `Other` as the **Authentication Type** based on the dropdown.
![Bitbucket - Auth0 Authentication Type list on Web3Auth Dashboard](/images/dashboard/create-verifier-google.png)
3. Enter the `Auth0 Client ID` and `Auth0 Domain` from your Auth0 application. See how to create a new Auth0 application
[here](https://auth0.com/docs/quickstart/webapp/).

![Bitbucket - Domain and Client ID from Auth0 Dashboard](/images/dashboard/create-verifier-auth0-filled-common.png)
![Bitbucket - Auth0 Client ID and Auth0 Domain on Web3Auth Dashboard](/images/dashboard/create-verifier-auth0-unfilled.png)

4. Add the [Bitbucket Social Connection](https://marketplace.auth0.com/integrations/bitbucket-social-connection) to your Auth0 application.
5. Click on the `Create` button to create `Bitbucket` Custom Authentication via Auth0 verifier.

### Example

```tsx
import { Web3AuthNoModal } from "@web3auth/no-modal";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";
// get it from https://dashboard.web3auth.io by creating a project.

const chainConfig = {
chainNamespace: "eip155",
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
displayName: "Ethereum Mainnet",
blockExplorer: "https://goerli.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
};

const web3auth = new Web3Auth({
clientId,
chainConfig,
web3AuthNetwork: "sapphire_mainnet",
});

const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig },
});

const openloginAdapter = new OpenloginAdapter({
privateKeyProvider,
adapterSettings: {
uxMode: "redirect",
loginConfig: {
jwt: {
verifier: "w3a-auth0-uk-demo", // Pass the Verifier name here
typeOfLogin: "jwt", // Pass on the login provider of the verifier you've created
clientId: "OfDAVldBEGslU9wjiWyQ1LPWOWNnnzim", // Pass on the Auth0 `Client ID` here
},
},
},
});
web3auth.configureAdapter(openloginAdapter);
setWeb3auth(web3auth);

// Initialize
await web3auth.init();

// Login with Bitbucket
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
domain: "https://web3auth.uk.auth0.com", // Pass on the Auth0 `Domain` here
verifierIdField: "sub", // Pass on the field name of the `sub` field in the JWT
connection: "bitbucket", // Use this to skip Auth0 Modal for Bitbucket login
},
});
```
Loading

0 comments on commit 3900762

Please sign in to comment.