反应:Securestore在移动设备上工作。如何在Web浏览器上确保JWT安全?

发布于 2025-02-10 19:39:07 字数 587 浏览 1 评论 0原文

Securestore do 不在网上工作,所以我要这样做:

async function getUserDetails() {      
    try { //Android and Apple 
        const token = await SecureStore.getItemAsync('token')
        const data = await axios.get(apiurl+'&JWT='+token)
        console.log('using SecureStore')

    } catch (err) { //Web
        const token = await AsyncStorage.getItem('token')
        const data = await axios.get(apiurl+'&JWT='+token)
        console.log('using AsyncStorage')
    }
}

因此,如果我想攻击自己的应用程序,我只使用浏览器,我将能够看到纯文本的JWT对吗?如何解决这个问题?

SecureStore does not work on Web, so I do this:

async function getUserDetails() {      
    try { //Android and Apple 
        const token = await SecureStore.getItemAsync('token')
        const data = await axios.get(apiurl+'&JWT='+token)
        console.log('using SecureStore')

    } catch (err) { //Web
        const token = await AsyncStorage.getItem('token')
        const data = await axios.get(apiurl+'&JWT='+token)
        console.log('using AsyncStorage')
    }
}

So if I want to attack my own app, I just use the browser, and i'll be able to see the JWT in plain text right? How to tackle this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朱染 2025-02-17 19:39:07

React Native主要在iosAndroid上使用,但是如果要在Web上使用此应用程序,则可以使用

React Native mostly use on ios and android but if you want to use this application on web you can encrypt those data using Crypto so you encrypt your data before you store them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文