Home  >  Article  >  Backend Development  >  类似微信微博客户端应用,如何实现让APP通过接口实现登陆一次就不用再次登陆(即登陆一次,就不会过期)?

类似微信微博客户端应用,如何实现让APP通过接口实现登陆一次就不用再次登陆(即登陆一次,就不会过期)?

WBOY
WBOYOriginal
2016-06-06 20:15:541859browse

常用的HTTP授权机制:

HTTP Basic (用户名和密码登陆)

JWT (Authenticiation Header)

又或者第三方客户端授权机制OAuth2.0(这里不属于我要问的问题)

回复内容:

常用的HTTP授权机制:

HTTP Basic (用户名和密码登陆)

JWT (Authenticiation Header)

又或者第三方客户端授权机制OAuth2.0(这里不属于我要问的问题)

登录时生成一个token给客户端,每次发送数据的时候带上这个token,token和设备做绑定

token有一个有效期,每次后台检查传入的token即将过期,就返回一个新的token

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn