oauth

nodejs实现OAuth2模式第三方GitHub授权登录

荒凉一梦 提交于 2020-01-23 05:53:29
什么是OAuth2 OAuth(Open Authorization,开放授权)协议为用户资源提供一个安全、开放而又简单的标准,是目前最流行的授权机制, 用于授权第三方应用。 OAuth的授权方式可以向第三方应用提供用户信息(比如头像、昵称等); 且不会使第三方触及到用户的用户名和密码,因此OAuth授权是安全的。 应用场景 第三方应用授权登录,例如:用支付宝或QQ账号授权登录优酷视频。 GitHub授权登录原理 网页登录认证,请求后台服务器 后台服务器重定向到GitHub认证 GitHub服务器第三方认证 GitHub服务器认证成功,回调带回认证状态code给后台服务器 后台 服务器用code想GitHub服务器申请令牌 申请成功,GitHub服务器向后台服务器返回认证令牌;后台服务器根据令牌获取GitHub用户信息 刷新页面 一、GitHub服务器配置 跳转GitHub 登录GitHub账户,点击设置里的Developer settings按钮,进入开发者配置 切换tab为OAuth Apps 点击New Oauth APP 配置授权页面,注册授权应用 Application name:应用名称 Homepage URL:应用首页地址 Application description:应用描述 Authorization callback URL:应用回调地址 注册完成

Google Service account user interfece

为君一笑 提交于 2020-01-23 04:56:08
问题 How can I login to a Google Service account with the normal web user interface, for example to google drive ? Now I can only login using API using script. 回答1: You cant. A service account is a sudo user type thing. Yes it has a Google drive account, Google calendar ... but you cant log in to the web interface for Service accounts. Option / work around / Tip: There is a slight workaround. You could have the service account give your Google account access to a directory on its Google drive.

how to Get the access token using oauth.js client library?

风流意气都作罢 提交于 2020-01-23 03:45:49
问题 I'm able to get request token verifier from the library(http://oauth.googlecode.com/svn/code/javascript/), But got stuck in getting the access token.. can someone tell me where i'm doing it wrong? function goForAccessRequest1(verifier){ var url2 = "http://www.google.com/accounts/OAuthGetAccessToken"; var accessor2 = { token: OAuthToken, //tokenSecret: OAuthTokenSecret, signatureMethod : "HMAC-SHA1", consumerKey : "1010722015153-i8tisqmaqch26b0muqvefbfp3h18m862.apps.googleusercontent.com", /

Guide me implementing Oauth2 PHP server using thephpleague library

余生颓废 提交于 2020-01-23 01:14:09
问题 I am using Slim Framework With Eloquent ORM. Trying to implement https://github.com/thephpleague/oauth2-server but I am totally confused how to do this. After adding this with composer, I created database with sql file provided in this package. Now it is suggested to implement Storage interfaces. I don't wanna do this, So I just copied storage classes found in Example Folder. I guess they should work as I am using same database right? Also it is unclear how to initially seed the db. Here's my

Youtube API: Upload to developer's account

五迷三道 提交于 2020-01-22 20:04:18
问题 here's what I want to achieve: Users are able to upload videos to my youtube account via a simple web form. Here's what I don't get: This is possible using the deprecated ClientLogin authentication. But it is not using OAuth 2.0 authentication, because this one's logging the user always in to his own account, not mine. Correct? If not, how do I use the OAuth authentication to enable users to upload videos to my youtube account? Thank you for your help! 回答1: Google's OAuth2 authorization

我与OAuth 2.0那点荒唐的小秘密

一个人想着一个人 提交于 2020-01-22 18:18:23
OAuth2.0这个名词你是否在项目中时常听到呢?是否觉得好像懂,又好像不太懂呢? 最近一直想写篇关于OAuth2.0的东西,记录下我的学习与感悟,然各种理由的拖延,直到今日才静下心来写下这篇博客。当然,这里仅代表个人理解,如有纰漏之处,望园内大佬们不吝赐教~ 好了,话不多说,干货顶上。 几个基本概念 认证(Authentication)和授权(Authorization) 在接触OAuth2.0时是否常听到认证和授权这两个名词呢? 刚接触时,一直以为这两个词是一个意思,只是大家说法的不同而已。然,在看完官方开发文档后才知道,这根本就是两个东西,不能混为一谈。下面详细说说: 认证: 主要用于验证身份。比如,我们进出火车站,身份证证明自己是张三而不是李四,这就是认证。 授权: 主要用于判断是否拥有相应的权限。比如,我们进出火车站,火车票证明我们有乘坐列车的权限,这就是授权。 现在 看看 ,是不是挺简单的概念,顿时清晰起来? OAuth定义的四个角色 资源拥有者: 受保护资源的拥有者,可以对他人授权,让其访问该资源。 资源服务器: 托管受保护资源的服务器,只要认证和授权通过,便可响应该资源。 客户端: 提出请求受保护资源的应用程序。 授权服务器: 当认证和授权成功后,给客户端发布访问令牌(access token)。 访问令牌 访问令牌,其实就是可以访问受保护资源的一个凭证。一般而言

WSGI Middleware for OAuth authentication

余生颓废 提交于 2020-01-22 12:16:44
问题 I have build a very small web application using Flask. Now I would like to add very basic authentication to the site (I don't need authorization). As Flask does not support auth&auth out of the box, I'd like to plug in a WSGI middleware doing this job. The web-app is only used by roughly 10 people, all of them are on Facebook. So I'd like to use Facebook's OAuth interface. I've quickly looked through the wsgi.org list of WSGI Middleware and noticed two things: The available middleware is

WSGI Middleware for OAuth authentication

三世轮回 提交于 2020-01-22 12:16:20
问题 I have build a very small web application using Flask. Now I would like to add very basic authentication to the site (I don't need authorization). As Flask does not support auth&auth out of the box, I'd like to plug in a WSGI middleware doing this job. The web-app is only used by roughly 10 people, all of them are on Facebook. So I'd like to use Facebook's OAuth interface. I've quickly looked through the wsgi.org list of WSGI Middleware and noticed two things: The available middleware is

WSGI Middleware for OAuth authentication

﹥>﹥吖頭↗ 提交于 2020-01-22 12:16:15
问题 I have build a very small web application using Flask. Now I would like to add very basic authentication to the site (I don't need authorization). As Flask does not support auth&auth out of the box, I'd like to plug in a WSGI middleware doing this job. The web-app is only used by roughly 10 people, all of them are on Facebook. So I'd like to use Facebook's OAuth interface. I've quickly looked through the wsgi.org list of WSGI Middleware and noticed two things: The available middleware is

理解OAuth 2.0

强颜欢笑 提交于 2020-01-21 18:36:07
理解OAuth 2.0 OAuth 是一个关于授权(authorization)的开放网络标准,在全世界得到广泛应用,目前的版本是2.0版。 本文对OAuth 2.0的设计思路和运行流程,做一个简明通俗的解释,主要参考材料为 RFC 6749 。 一、应用场景 为了理解OAuth的适用场合,让我举一个假设的例子。 有一个"云冲印"的网站,可以将用户储存在Google的照片,冲印出来。用户为了使用该服务,必须让"云冲印"读取自己储存在Google上的照片。 问题是只有得到用户的授权,Google才会同意"云冲印"读取这些照片。那么,"云冲印"怎样获得用户的授权呢? 传统方法是,用户将自己的Google用户名和密码,告诉"云冲印",后者就可以读取用户的照片了。这样的做法有以下几个严重的缺点。 (1)"云冲印"为了后续的服务,会保存用户的密码,这样很不安全。 (2)Google不得不部署密码登录,而我们知道,单纯的密码登录并不安全。 (3)"云冲印"拥有了获取用户储存在Google所有资料的权力,用户没法限制"云冲印"获得授权的范围和有效期。 (4)用户只有修改密码,才能收回赋予"云冲印"的权力。但是这样做,会使得其他所有获得用户授权的第三方应用程序全部失效。 (5)只要有一个第三方应用程序被破解,就会导致用户密码泄漏,以及所有被密码保护的数据泄漏。