javascript - How to store login information for an api which requires Username - Password for the next session
问题描述
I'm working with an unofficial n26 API (https://github.com/PierrickP/n26/tree/develop). The api requires the email and password to login to the account. I don't want the user to login every single time so I need to store these information somehow. I can't find any way to get a session token or something for later use from the api. (maybe someone of you can find it??)
So my question: How do I store Email/Password for later use in a secure way?
const N26 = require('n26');
// Log into the account
const account = new N26('example@mail.com', 'password');
// Get the last 10 transactions
account.then(account => account.transactions({limit: 10}))
.then(transactions => {
// Do something with it
});
解决方案
http://www.passportjs.org/查看这个包。
需要考虑的事项:
- 带有刷新令牌的 json Web 令牌
- API 密钥
推荐阅读
- arrays - In TSQL Can I/How can I fill an array with data from a table?
- python - Defaultdict 和 lambda 函数一起使用
- excel - else if statement for check in check out sheet vba not working
- laravel - 在 Livewire 中使用 Model::query 查询数据透视表
- html - 您如何正确链接回 Word 新闻 HTML 页面
- java - READ_CALL_LOG 权限的 Android 问题
- android - Android:在后台发出 Volley HTTP 请求
- html - 如何按固定比例调整所有 HTML 标题的大小?
- lightbox2 - 灯箱 2 全屏
- kotlin - 在Jetpack compose中Imageview的基础上调整Texview