Note that there are some explanatory texts on larger screens.

plurals
  1. POgithub issues api 401, why? (django)
    primarykey
    data
    text
    <p>I'm trying to integrate github issues api into a project. I think I'm following the rules of oauth, and everything that is needed and mentioned on <a href="http://develop.github.com/p/issues.html">http://develop.github.com/p/issues.html</a>, but it doesn't seem to work. I don't get detailed error message, just a 401.</p> <ul> <li>i registered an oauth app at github(api v2), and provided the callback url.</li> <li>i construct the auth url: <a href="https://github.com/login/oauth/authorize?client_id=...&amp;redirect_uri=http://.../no_port/">https://github.com/login/oauth/authorize?client_id=...&amp;redirect_uri=http://.../no_port/</a></li> <li>They post the code for me(request token), i exchange it ho access token, it works fine. The problems:</li> <li>I can watch my own issues on my own repos, but if i'm just a collaborator, it's 401(unauthorized)</li> <li>There's no way to create a new issue, even on my own repo: POST: <a href="http://github.com/api/v2/json/issues/open/:user/:repo">http://github.com/api/v2/json/issues/open/:user/:repo</a> PARAMS: body=&amp;login=&amp;token=6&amp;title=</li> </ul> <p>actual implementatios with django, python:</p> <pre><code>url = 'https://github.com/login/oauth/access_token?client_id=%(client_id)s&amp;redirect_uri=%(redirect_uri)s&amp;client_secret=%(client_secret)s&amp;code=%(code)s' % locals() req = urllib2.Request(url) response = urllib2.urlopen(req).read() access_token = re.search(r'access_token=(\w+)', response).group(1) url = 'http://github.com/api/v2/json/issues/open/%(user)s/%(repo)s' % locals() params = urllib.urlencode({'login': user, 'token': access_token, 'title': 'title', 'body': 'body'}) req = urllib2.Request(url, params) try: response = urllib2.urlopen(req) except HTTPError, e: return HttpResponse('[*] Its a fckin %d' % e.code) except URLError, e: return HttpResponse('[*] %s\n' % repr(e.reason)) else: resp = json.loads(response.read()) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload