OAuth 2.0授权标头 [英] OAuth 2.0 Authorization Header

查看:116
本文介绍了OAuth 2.0授权标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个封装OAuth 2.0功能的SDK。我检查了OAuth 1.0和amp;之间的差异。 2.0,我对授权标题有一些困惑( 1.0
2.0 ),可以使用HTTP授权标题传输OAuth 1.0协议参数,但我找不到当前OAuth 2.0草案中描述的内容。

I want to develop a SDK that encapsules the OAuth 2.0 functions. I have checked the differences between OAuth 1.0 & 2.0, and I have some confusion on Authorization Header (1.0 and 2.0), OAuth 1.0 protocol parameters can be transmitted using the HTTP "Authorization" header, but I can't find this described in current OAuth 2.0 draft.

OAuth 2.0是否支持授权标题?

Does OAuth 2.0 supports authorization headers?

在OAuth 1.0中,您的标题如下所示:

In OAuth 1.0 your header would look like:

Authorization: OAuth realm="Example",
    oauth_consumer_key="0685bd9184jfhq22",
    oauth_token="ad180jjd733klru7",
    oauth_signature_method="HMAC-SHA1",
    oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
    oauth_timestamp="137131200",
    oauth_nonce="4572616e48616d6d65724c61686176",
    oauth_version="1.0"


推荐答案

对于那些寻找如何传递OAuth2作者的例子的人标题中的化(访问令牌)(与使用请求或正文参数相反),这是如何完成的:

For those looking for an example of how to pass the OAuth2 authorization (access token) in the header (as opposed to using a request or body parameter), here is how it's done:

Authorization: Bearer 0b79bab50daca910b000d4f1a2b675d604257e42

这篇关于OAuth 2.0授权标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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