在Cookie中直接在客户端计算机上保存OAuth WRAP访问令牌? [英] Save OAuth WRAP access tokens directly on client machine in a cookie?

查看:121
本文介绍了在Cookie中直接在客户端计算机上保存OAuth WRAP访问令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算设置一个访问oauth包装框架的网站。我想在客户端机器上存储访问令牌,因为它是。我不想在服务器上维护临时令牌等数据库。

I'm planning to setup a website that would access an oauth wrap framework. I was thinking of storing the access token on the client machine as it is. I do NOT want to maintain a database of temporary tokens, etc on the server.

我应该怎么办?

推荐答案

首先,为什么他们不使用OAuth 2.0 ...

First, why are they not using OAuth 2.0...

您可以将OAuth凭据存储在cookie或更好的HTML5本地存储中。应该对其进行加密,以便只有服务器才能访问此Cookie,并且只有服务器才能使用令牌。此外,它应该是一个安全的cookie,以防止泄漏。请至少做其中一个(安全,加密)。

You can store the OAuth credentials in a cookie or better yet, in HTML5 local storage. It should be encrypted so that only the server has access to this cookie and only the server can use the token. Also, it should be a secure cookie to prevent it from leaking out. Do at least one of these two (secure, encrypt).

但请记住,Cookie可能会丢失,如果用户登录到您的网站,它不会从其他机器工作。

But keep in mind that cookies can be lost, and if they user logs into your site, it will not work from other machines.

这篇关于在Cookie中直接在客户端计算机上保存OAuth WRAP访问令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆