In a previous post I looked at how to authenticate and request a token programmatically in an implicit authentication with a desktop client using Python. The script worked fine for some time, until it didn't.
Looking more closely, the response URL was the same as the request URL i.e. https://stackexchange.com/oauth/dialog?client_id=54&scope=read_inbox&redirect_uri=https://stackexchange.com/oauth/login_success and no 302 redirect took place between the two (the sub-classed urllib2.HTTPRedirectHandler's method http_error_302() is not called at all). The HTTP response returned the following:
<html>
<head>
<title>Authorizing Stack-Exchange Plugin for Cairo-Dock - Stack Exchange</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/Content/Js/third-party/jquery.cookie.js"></script>
<script type="text/javascript" src="/Content/Js/master.js"></script>
<script type="text/javascript" src="/Content/js/global-login.js?v=13"></script>
<script type="text/javascript">
gauth.informStackAuth('https://stackauth.com', function() { window.location = 'https://stackexchange.com/oauth/login_success#access_token=t045GDfq(kToWSr8tnjJGg))&expires=86400' });
</script>
<link rel="stylesheet" href="/Content/all.css" type="text/css" />
</head>
<body>
<div style="padding-top:50px; margin:0 auto;">
<h2>You are being returned to Stack-Exchange Plugin for Cairo-Dock</h2>
</div>
<div id="footer"></div>
</body>
</html>
Although I am now able to pick up the token from the HTML, it seems this response is not proper. I am not literate enough with HTTP requests or web-development to understand what could possible be happening here. So I would like to know if you have any idea as to what the problem might be. Thanks.