diff --git a/docs/sdk/pnp/android/android.mdx b/docs/sdk/pnp/android/android.mdx index 57c2aedb0..803b6e476 100644 --- a/docs/sdk/pnp/android/android.mdx +++ b/docs/sdk/pnp/android/android.mdx @@ -10,7 +10,7 @@ authenticate users using Web3Auth. For using Web3Auth natively in Android, Web3A key generated in a non-custodial way on successful user authentication. This authentication can be achieved by using any social login options that Web3Auth supports or custom authentication flow of your choice. -#### This Documentation is based on the `5.1.1` SDK Version. +#### This Documentation is based on the `5.3.1` SDK Version. ## Requirements diff --git a/docs/sdk/pnp/android/initialize.mdx b/docs/sdk/pnp/android/initialize.mdx index 653e60697..36a5ef078 100644 --- a/docs/sdk/pnp/android/initialize.mdx +++ b/docs/sdk/pnp/android/initialize.mdx @@ -52,6 +52,8 @@ The Web3Auth Constructor takes an object with `Web3AuthOptions` as input. | loginConfig | LoginConfigItem | No | A configuration optional object to use custom authentication. Refer [Custom Authentication](/pnp/features/custom-authentication) for more info. | | useCoreKitKey | Boolean | No | Use Core Kit Key true to the Core Kit keys. | | chainNamespace | enum com.web3auth.core.Web3Auth.ChainNamespace ["EIP155", "SOLANA"] | No | A configuration optional object to use chain namespace. | +| `mfaSettings` | MfaSettings | No | MFA Settings | +| `sessionTime` | `Int | No | Session Time in seconds, default is `86400` seconds | @@ -59,15 +61,18 @@ The Web3Auth Constructor takes an object with `Web3AuthOptions` as input. ```kotlin data class Web3AuthOptions( - var context: Context, - val clientId: String, - val network: Network, - @Transient var redirectUrl: Uri? = null, - var sdkUrl: String = getSdkUrl(network), - val whiteLabel: WhiteLabelData? = null, - val loginConfig: HashMap? = null, - val useCoreKitKey: Boolean? = false, - val chainNamespace: ChainNamespace? = ChainNamespace.EIP155 + var context: Context, + val clientId: String, + val network: Network, + var buildEnv: BuildEnv? = BuildEnv.PRODUCTION, + @Transient var redirectUrl: Uri? = null, + var sdkUrl: String = getSdkUrl(buildEnv), + val whiteLabel: WhiteLabelData? = null, + val loginConfig: HashMap? = null, + val useCoreKitKey: Boolean? = false, + val chainNamespace: ChainNamespace? = ChainNamespace.EIP155, + val mfaSettings: MfaSettings? = null, + val sessionTime: Int? = 86400 ) ``` @@ -101,6 +106,53 @@ Add the below line to your `app/res/values/strings.xml` file: ``` +### Using the `mfaSettings` to configure MFA Order + +You can configure the order of MFA or enable/disable MFA type by passing the `mfaSettings` object in `Web3AuthOptions`. + +`MfaSettings` + + + + + +`deviceShareFactor` | `backUpShareFactor` | `socialBackupFactor` | `passwordFactor` + +| Parameter | Type | Mandatory | Description | +| ----------- | ------ | --------- | ---------------------- | +| `enable` | `bool` | Yes | Enable/Disable MFA | +| `priority` | `int` | No | Priority of MFA | +| `mandatory` | `bool` | No | Mandatory/Optional MFA | + + + + + +```kotlin + data class MfaSetting( + var enable: Boolean, + var priority: Int?, + var mandatory: Boolean? + ) + + data class MfaSettings( + private var deviceShareFactor: MfaSetting? = null, + private var backUpShareFactor: MfaSetting? = null, + private var socialBackupFactor: MfaSetting? = null, + private var passwordFactor: MfaSetting? = null, + ) +``` + + + + + ### Session Management The Session Management feature allows you to check the existing sessions with Web3Auth. The `sessionResponse()` will allow users to remain diff --git a/docs/sdk/pnp/android/install.mdx b/docs/sdk/pnp/android/install.mdx index 44f35ed04..7cc5d4a27 100644 --- a/docs/sdk/pnp/android/install.mdx +++ b/docs/sdk/pnp/android/install.mdx @@ -27,7 +27,7 @@ Then, in your app-level `build.gradle` dependencies section, add the following: dependencies { // ... // highlight-next-line - implementation 'com.github.Web3Auth:web3auth-android-sdk:5.0.2' + implementation 'com.github.Web3Auth:web3auth-android-sdk:5.3.1' } ``` diff --git a/docs/sdk/pnp/android/mfa.mdx b/docs/sdk/pnp/android/mfa.mdx index 553ee9c57..6ecee5571 100644 --- a/docs/sdk/pnp/android/mfa.mdx +++ b/docs/sdk/pnp/android/mfa.mdx @@ -57,3 +57,84 @@ class MainActivity : AppCompatActivity() { // ... } ``` + +## Using the `mfaSettings` to configure MFA Order + +You can configure the order of MFA or enable/disable MFA type by passing the `mfaSettings` object in `Web3AuthOptions`. + +`MfaSettings` + + + + + +`deviceShareFactor` | `backUpShareFactor` | `socialBackupFactor` | `passwordFactor` + +| Parameter | Type | Mandatory | Description | +| ----------- | ------ | --------- | ---------------------- | +| `enable` | `bool` | Yes | Enable/Disable MFA | +| `priority` | `int` | No | Priority of MFA | +| `mandatory` | `bool` | No | Mandatory/Optional MFA | + + + + + +```kotlin + data class MfaSetting( + var enable: Boolean, + var priority: Int?, + var mandatory: Boolean? + ) + + data class MfaSettings( + private var deviceShareFactor: MfaSetting? = null, + private var backUpShareFactor: MfaSetting? = null, + private var socialBackupFactor: MfaSetting? = null, + private var passwordFactor: MfaSetting? = null, + ) +``` + + + + + +```kotlin + web3Auth = Web3Auth( + Web3AuthOptions( + context = this, + clientId = getString(R.string.web3auth_project_id), // pass over your Web3Auth Client ID from Developer Dashboard + network = Network.SAPPHIRE_MAINNET, // pass over the network you want to use (MAINNET or TESTNET or CYAN, AQUA, SAPPHIRE_MAINNET or SAPPHIRE_TESTNET) + buildEnv = BuildEnv.PRODUCTION, + redirectUrl = Uri.parse("com.w3a.web3authdemoapp://auth"), // your app's redirect URL + // Optional parameters + whiteLabel = WhiteLabelData( + "Web3Auth Android FireBase Example", + null, + null, + null, + Language.EN, + ThemeModes.LIGHT, + true, + hashMapOf( + "primary" to "#eb5424" + ) + ), + // highlight-start + mfaSettings = MfaSettings( + deviceShareFactor = MfaSetting(true, 1, true), + socialBackupFactor = MfaSetting(true, 2, false), + passwordFactor = MfaSetting(true, 3, false), + backUpShareFactor = MfaSetting(true, 4, false), + ) + // highlight-end + ... // add your loginconfig + ) + ) +``` diff --git a/docs/sdk/pnp/android/whitelabel.mdx b/docs/sdk/pnp/android/whitelabel.mdx index 2bb149f0b..0c27aa298 100644 --- a/docs/sdk/pnp/android/whitelabel.mdx +++ b/docs/sdk/pnp/android/whitelabel.mdx @@ -27,16 +27,16 @@ Object called `whiteLabel`. This parameter takes another object called `WhiteLab -| Parameter | Type | Mandatory | Description | -| ----------------- | ------------------ | --------- | --------------------------------------- | -| `appName` | `String` | No | Name of your application | -| `appUrl` | `String` | No | Url of your application | -| `logoLight` | `String` | No | Light logo for dark background | -| `logoDark` | `String` | No | Dark logo for light background | -| `defaultLanguage` | `String` | No | Default translation language to be used | -| `mode` | `Boolean` | No | 3 Theme modes of the application | -| `theme` | `Map` | No | Whitelabel theme | -| `useLogoLoader` | `Boolean` | No | Loads the logo when loading | +| Parameter | Type | Description | Default | Mandatory | +| ------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------- | +| `appName?` | `string` | App name to be displayed in the User Flow Screens. | dApp's Website URL | No | +| `appUrl?` | `string` | App URL to be displayed in the User Flow Screens. | dApp's Website URL | No | +| `logoLight?` | `string` | App logo to be shown on the dark background (dark theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | +| `logoDark?` | `string` | App logo to be shown on the light background (light theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | +| `defaultLanguage?` | `string` | Default Language to use.
Choose from:
  • `Language.EN` - English
  • `Language.DE` - German
  • `Language.JA` - Japanese
  • `Language.KO` - Korean
  • `Language.ZH` - Mandarin
  • `Language.ES` - Spanish
  • `Language.FR` - French
  • `Language.PT` - Portuguese
  • `Language.NL` - Dutch
| en - English | No | +| `mode?` | `string` | Choose between `auto`, `light` or `dark` modes. | `auto` | No | +| `theme?` | `Map` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content | `#0364FF` | No | +| `useLogoLoader` | `Boolean` | Loads the logo when loading | false | No |