首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Web API身份验证

Web API身份验证
EN

Stack Overflow用户
提问于 2013-11-11 01:25:30
回答 1查看 564关注 0票数 0

我一直在尝试对我将要开发的API进行身份验证。

我试图想出一种方法来成功地对用户进行身份验证,记住用户可以访问客户端上的所有数据,我提出了这个想法。

代码语言:javascript
复制
Client sends username and password to the server
Server checks if they match a user.
    If it does, we create a hashed string with user_id+e-mail+currentTime+salt
    and stores this in a database-table with an expiration date.
Server returns hashed string to client

Client sends random request to server including key
Server checks if key is correct and if it's expired

这是一种安全的方式吗,或者你看到任何安全缺陷了吗?

EN

回答 1

Stack Overflow用户

发布于 2013-11-11 01:30:04

首先,Do i see security flaws?是和否。如果您使用的不是安全连接,则通过网络发送用户密码和用户名不是一个好主意。特别是如果您没有在sha512或您使用的任何东西中散列用户的密码。

我会在客户端散列密码,然后发送它。

以Twitter的API为例。他们还使用密钥来验证您的帐户。

这是一个有用的article

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19892697

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档