# \[Archive\] How to get a private key from redirect url in v7?

**URL:** <https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [November 27, 2023, 6:42am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681 "2023-11-27T06:42:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@samuel](https://builder.metamask.io/u/samuel)\
**Post date:** [November 27, 2023, 6:42am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/1 "2023-11-27T06:42:35Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **samuel** on 11/27/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

When asking for help in this category, please make sure to provide the following details:

- SDK Version: 7.1.2
- Platform: android (mobile web)

When using v5 OpenloginAdapter with uxMode as “redirect” then I got url like below `https://app-redirecturl/#result=[base64strings]`.  
So I could get private key from result hash data.

But when using v7 OpenloginAdapter I got url like below `https://app-redirecturl/#sessionId=[sessionid]&sessionNamespace=`

Is there an option in v7 to get the URL like in v5?  
or how do I get private key using the sessionId?

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)\
**Post date:** [November 27, 2023, 9:34am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/2 "2023-11-27T09:34:11Z")

</div>

@samuel Your request has been forwarded to our Dev team and we will get back with further updates.

---

<div class="post-metadata">

**Author:** ![maharshi](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/maharshi/32/1525_2.png) [@maharshi](https://builder.metamask.io/u/maharshi)\
**Post date:** [November 27, 2023, 10:23am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/3 "2023-11-27T10:23:31Z")

</div>

Hey @samuel  
This is not the way we usually recommended users to get the private key, please have a look at our examples to request for a private key upon login. Linking it [here](https://github.com/Web3Auth/web3auth-pnp-examples/blob/8973c99c4bbaf817280da8bff186cfb8879de650/web-no-modal-sdk/blockchain-connection-examples/evm-no-modal-example/src/ethersRPC.ts#L126-L136).

---

<div class="post-metadata">

**Author:** ![samuel](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@samuel](https://builder.metamask.io/u/samuel)\
**Post date:** [November 28, 2023, 12:55am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/4 "2023-11-28T00:55:45Z")

</div>

I know that way as your link, but i have developed webview application by capacitor so I couldn’t connecting with innner webview, I want to know how connecting a webview application with redirected external web.  
I’ve got a key in my app from redirected url on v5, so i want to know by same way on v7  
or how to get a provider or key with using sessionId

---

<div class="post-metadata">

**Author:** ![samuel](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@samuel](https://builder.metamask.io/u/samuel)\
**Post date:** [November 29, 2023, 6:04am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/5 "2023-11-29T06:04:56Z")

</div>

@maharshi Is there any other way?

---

<div class="post-metadata">

**Author:** ![maharshi](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/maharshi/32/1525_2.png) [@maharshi](https://builder.metamask.io/u/maharshi)\
**Post date:** [December 1, 2023, 6:29am UTC](https://builder.metamask.io/t/archive-how-to-get-a-private-key-from-redirect-url-in-v7/1681/6 "2023-12-01T06:29:06Z")

</div>

Hey @samuel,  
We always strive towards the improvement of security and robusticity of the product. While we appreciate the work-around that you had devised but unfortunately, it’s best for the product and the users that private key is not accessible without authentication.  
Clearing your doubts on the above, I would like to bring your attention to our Lookup API / Pre-generation API which will launch within a few weeks, which will allow you to pre-determine the wallet address without logging in. Will keep you posted once it’s launched.
