dougua3706 2012-06-16 06:16
浏览 174
已采纳

github API v3 - 通过CURL获取访问令牌

I've been puzzling through the github API docs (v3) and I'm kind of stumped. For the initial step - the acquisition of the access token - it appears that the only way to do it within a web app is to rely on a callback URL, which gets posted a temporary code. That's then used in subsequent queries to their API.

Does anyone know if this can all be done in a single step, e.g. cURL - i.e. within a single block of code in one page? Passing off control flow to a different URL causes innumerable problems for my particular scenario.

Thanks! :)

  • 写回答

1条回答 默认 最新

  • dongyizhui0616 2012-06-16 06:21
    关注

    This is the nature of OAuth. You could you try to use the basic authentication method, but if that doesn't fit your needs, then PHP has an OAuth library that should make authentication pretty painless. There are also a few PHP wrappers out there for the Github API, e.g. php-github-api.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?