Yammer API交替响应302和404
本文关键字:响应 API Yammer | 更新日期: 2023-09-27 18:24:57
我通过.NET以编程方式信任我的yammer应用程序。在调试POST请求以信任应用程序时,当响应试图重定向到SharePoint MySite主机时,响应似乎可以任意呈现302或404。
如果我在同一个调试会话中循环我的请求,我会得到相同类型的响应。我必须重新启动调试才能有机会得到不同的响应。我试着设定一分钟的睡眠时间,以确保时间与我得到的反应类型无关。同样的规则似乎也适用:一个调试会话,一个响应类型。
我现在的问题是:我需要做什么来避免这些404?
以下是小提琴手的回应:
302回应:
POST https://www.yammer.com/MYNETWORK/oauth2/decision?client_id=MYAPPCODE&redirect_uri=http%3a%2f%2fmy.devmachine.contoso.com&response_type=code HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: www.yammer.com
Cookie: yamtrak_id=[GUID]; _workfeed_session_id=[ID] Content-Length: 90
Expect: 100-continue
utf8=%E2%9C%93&authenticity_token=[TOKEN]=&allow=Allow
HTTP/1.1 302 Found
Server: nginx
Date: Mon, 29 Sep 2014 13:21:51 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Status: 302 Found
Location: http://my.devmachine.contoso.com?code=[CODE] X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: SAMEORIGIN
Cache-Control: no-cache
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
X-UA-Compatible: IE=Edge,chrome=1
Set-Cookie: yamtrak_id=[ID]; path=/; expires=Tue, 29-Sep-2015 13:21:51 GMT; secure; HttpOnly
Set-Cookie: auth_token=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT; secure
Set-Cookie: auth_token_sso=; domain=yammer.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT; secure
X-Date: 1411996911966
X-Runtime: 0.073263
7e
<html><body>You are being <a href="http://my.devmachine.contoso.com?code=[CODE]">redirected</a>.</body></html>
0
404回应:
POST https://www.yammer.com/MYNETWORK/oauth2/decision?client_id=MYAPPCODE&redirect_uri=http%3a%2f%2fmy.devmachine.contoso.com&response_type=code HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: www.yammer.com
Cookie: yamtrak_id=[GUID]; _workfeed_session_id=[ID]
Content-Length: 90
Expect: 100-continue
utf8=%E2%9C%93&authenticity_token=[TOKEN]=&allow=Allow
HTTP/1.1 404 Not Found
Server: nginx
Date: Mon, 29 Sep 2014 13:26:03 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 404 Not Found
Cache-Control: no-cache
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
X-UA-Compatible: IE=Edge,chrome=1
X-Date: 1411997163223
X-Runtime: 0.068703
a45
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8,chrome=1" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>The page you were looking for doesn't exist (404)</title>
<link href="/stylesheets/yamkit/yam.css" media="screen, projection" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
...
<div id="parallax-static">
<div id="parallax-static-text">
<h1>Oops!</h2>
<h2>The page you were looking for could not be found.</h2>
<a href="/" title="">Let's go back to your happy place.</a>
</div>
</div>
...
</body>
</html>
0
我知道这个论坛中的其他yammer线程,我正在使用新的login_csrf_token cookie进行身份验证,所以这不应该是问题所在。
感谢阅读!我很感激你对如何解决这个问题提出的任何建议。
编辑:我试着将另一个网站(谷歌)设置为我的重定向url,但这种交替的行为仍然存在。
发现:有时真实性令牌包含加号(+),需要对其进行URL编码。令牌也可以包含前斜杠(/),但它们不会中断对/session或/oauth2/decision的后续调用,只有plus会。