Skip to content

Commit 9669672

Browse files
update docs for Flutter
1 parent 07e654a commit 9669672

5 files changed

Lines changed: 97 additions & 218 deletions

File tree

docs/sdk/pnp/flutter/custom-authentication.mdx

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ description: "Web3Auth PnP Flutter SDK - Using Custom Authentication | Documenta
88
import TabItem from "@theme/TabItem";
99
import Tabs from "@theme/Tabs";
1010

11-
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you can
12-
add the configuration to the `loginConfig` parameter of the `LoginParams` object during the initialization.
11+
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you
12+
can add the configuration to the `loginConfig` parameter of the `LoginParams` object during the initialization.
1313

1414
The `loginConfig` parameter is a key value map. The key should be one of the `TypeOfLogin` in its string form, and the value should be a
1515
`LoginConfigItem` struct.
@@ -32,8 +32,8 @@ Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)**
3232

3333
:::note
3434

35-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the
36-
**Growth Plan**. You can use this feature in the development environment for free.
35+
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **Growth
36+
Plan**. You can use this feature in the development environment for free.
3737

3838
:::
3939

@@ -55,21 +55,21 @@ Then, specify the details of your verifier in the `LoginConfigItem` struct as fo
5555

5656
<TabItem value="table">
5757

58-
| Parameter | Type | Mandatory | Description |
59-
| --------------------- | ------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60-
| `verifier` | `String` | Yes | The name of the verifier that you have registered on the Web3Auth Dashboard. |
61-
| `typeOfLogin` | `TypeOfLogin` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. |
62-
| `clientId` | `String` | Yes | The Client Id of the login provider. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. |
63-
| `name` | `String?` | No | Name of your verifier. |
64-
| `description` | `String?` | No | Description of this login flow. |
65-
| `verifierSubIdentifier` | `String?` | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used. |
66-
| `logoHover` | `String?` | No | Logo to be shown on mouse hover. |
67-
| `logoLight` | `String?` | No | Light logo for dark background |
68-
| `logoDark` | `String?` | No | Dark logo for light background |
69-
| `mainOption` | `bool?` | No | Show login button on the main list |
70-
| `showOnModal` | `bool?` | No | Whether to show the login button on modal or not |
71-
| `showOnDesktop` | `bool?` | No | Whether to show the login button on desktop |
72-
| `showOnMobile` | `bool?` | No | Whether to show the login button on mobile |
58+
| Parameter | Description |
59+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60+
| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `String` as a value. |
61+
| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. |
62+
| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `String` as a value. |
63+
| `name?` | Display name for the verifier. If null, the default name is used. It accepts `String` as a value. |
64+
| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `String` as a value. |
65+
| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `String` as a value. |
66+
| `logoHover?` | Logo to be shown on mouse hover. It accepts `String` as a value. |
67+
| `logoLight?` | Light logo for dark background. It accepts `String` as a value. |
68+
| `logoDark?` | Dark logo for light background. It accepts `String` as a value. |
69+
| `mainOption?` | Show login button on the main list. It accepts `bool` as a value. |
70+
| `showOnModal?` | Whether to show the login button on modal or not. |
71+
| `showOnDesktop?` | Whether to show the login button on desktop. |
72+
| `showOnMobile?` | Whether to show the login button on mobile. |
7373

7474
</TabItem>
7575

@@ -325,14 +325,29 @@ enabling login. The `ExtraLoginOptions` accepts the following parameters:
325325

326326
<TabItem value="table">
327327

328-
| Parameter | Type | Description |
329-
| --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------- |
330-
| `domain` | `string` | Your Auth0 account domain such as `example.auth0.com` or `example.mycompany.com` etc. |
331-
| `client_id` | `string` | The Client ID found on your Auth0 Application settings page. **Use web3auth client id in case of custom JWT login.** |
332-
| `redirect_uri` | `string` | The default URL where Auth0 will redirect your browser to with the authentication result. |
333-
| `leeway` | `number` | The value in seconds used to account for clock skew in JWT expirations. |
334-
| `verifierIdField` | `string` | The field in jwt token which maps to verifier id. |
335-
| `isVerifierIdCaseSensitive` | `boolean` | Whether the verifier id field is case sensitive. Defaults to `true` |
328+
| Parameter | Description |
329+
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
330+
| `additionalParams?` | Additional params in `Map` format for OAuth login, use id_token(JWT) to authenticate with web3auth. |
331+
| `domain?` | Your custom authentication domain in `String` format. For example, if you are using Auth0, it can be example.au.auth0.com. |
332+
| `client_id?` | Client id in `String` format, provided by your login provider used for custom verifier. |
333+
| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `String` as a value. |
334+
| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `String` as a value. |
335+
| `isVerifierIdCaseSensitive?` | Boolean to confirm Whether the verifier id field is case sensitive or not. |
336+
| `display?` | Allows developers the configure the display of UI. It takes `Display` as a value. |
337+
| `prompt?` | Prompt shown to the user during authentication process. It takes `Prompt` as a value. |
338+
| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `String` as a value. |
339+
| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. |
340+
| `id_token_hint?` | It denotes the previously issued ID token. It takes `String` as a value. |
341+
| `id_token?` | JWT (ID Token) to be passed for login. |
342+
| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `String` as a value. |
343+
| `acr_values?` | acc_values |
344+
| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `String` as a value. |
345+
| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `String` as a value. |
346+
| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `String` as a value. |
347+
| `state?` | state |
348+
| `response_type?` | Defines which grant to execute for the authorization server. It takes `String` as a value. |
349+
| `nonce?` | nonce |
350+
| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. |
336351

337352
</TabItem>
338353

@@ -525,8 +540,9 @@ final Web3AuthResponse response = await Web3AuthFlutter.login(
525540

526541
### Email Passwordless
527542

528-
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of the `ExtraLoginOptions`. By default, the login flow
529-
will be `code` flow, if you want to use the `link` flow, you need to put `flow_type` into the `additionalParams` parameter of the `ExtraLoginOptions`.
543+
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of the `ExtraLoginOptions`. By default, the login
544+
flow will be `code` flow, if you want to use the `link` flow, you need to put `flow_type` into the `additionalParams` parameter of the
545+
`ExtraLoginOptions`.
530546

531547
```dart
532548
Future<void> initWeb3Auth() async {

0 commit comments

Comments
 (0)