You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once initialized, you can use the `web3Auth.connectTo(LoginParams("{selectedLoginProvider}"))` function to authenticate the user when they click the login button.
148
+
Once initialized, you can use the `web3Auth.connectTo(LoginParams(...))` function to authenticate the user when they click the login button.
149
149
150
150
```kotlin
151
151
privatefunsignIn() {
152
-
val selectedLoginProvider =Provider.JWT// For Auth0, we use JWT
153
152
val loginCompletableFuture:CompletableFuture<Web3AuthResponse> = web3Auth.connectTo(
Once initialized, you can use the `web3Auth.connectTo(LoginParams("{selectedLoginProvider}"))` function to authenticate the user when they click the login button.
141
+
Once initialized, you can use the `web3Auth.connectTo(LoginParams(...))` function to authenticate the user when they click the login button.
142
142
143
143
```kotlin
144
144
privatefunsignIn() {
@@ -155,17 +155,15 @@ private fun signIn() {
155
155
val idToken = result.token
156
156
157
157
Log.d(TAG, "GetTokenResult result = $idToken")
158
-
val selectedLoginProvider =Provider.JWT
159
158
// focus-start
160
159
val loginCompletableFuture:CompletableFuture<Web3AuthResponse> = web3Auth.connectTo(
Copy file name to clipboardExpand all lines: embedded-wallets/connect-blockchain/_android-connect-blockchain/_evm-get-account.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
Once user has successfully logged in, you can retrieve the user's private key using the `getPrivKey` method from the Embedded Wallets Android SDK. We'll use this private key to generate the Credentials for the user.
1
+
Once user has successfully logged in, you can retrieve the user's private key using the `getPrivateKey` method from the Embedded Wallets Android SDK. We'll use this private key to generate the Credentials for the user.
2
2
3
3
This Credentials object has the user's keypair of private key and public key, and can be used to sign the transactions. Please note, that this assumes that the user has already logged in and the private key is available.
4
4
5
5
```kotlin
6
6
importorg.web3j.crypto.Credentials
7
7
8
8
// Use your Embedded Wallets SDK instance to get the private key
// Check whether private key is empty or not for user authentication status.
150
-
val isUserAuthenticated = web3Auth.getPrivkey().isNotEmpty()
150
+
val isUserAuthenticated = web3Auth.getEd25519PrivateKey().isNotEmpty()
151
151
152
152
// Customize your logic to perform operations or navigation
153
153
```
154
154
155
155
## Get account
156
156
157
-
We can use `getEd25519PrivKey` method in Web3Auth to retrieve the private key for the Solana ecosystem. In the following code block, we'll use the Ed25519 private key to retrieve user's public address by creating `Keypair`. The `Keypair` instance from `sol4k` SDK once created can be used to sign the Solana transactions.
157
+
We can use `getEd25519PrivateKey` method in Web3Auth to retrieve the private key for the Solana ecosystem. In the following code block, we'll use the Ed25519 private key to retrieve user's public address by creating `Keypair`. The `Keypair` instance from `sol4k` SDK once created can be used to sign the Solana transactions.
158
158
159
159
```kotlin
160
-
val ed25519PrivateKey = web3Auth.getEd25519PrivKey()
160
+
val ed25519PrivateKey = web3Auth.getEd25519PrivateKey()
161
161
val solanaKeyPair =Keypair.fromSecretKey(ed25519PrivateKey.hexToByteArray())
0 commit comments