Github GET在带有访问令牌的私人仓库上 [英] Github GET on private repo with access token

查看:135
本文介绍了Github GET在带有访问令牌的私人仓库上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在组织中有一个私人存储库,我需要提供访问权限.我希望能够通过GET请求(浏览器)访问文件.我没有端子,卷曲或任何其他工具.

I have a private repo in my org and I need to provide access. I want to be able to access a file through a GET request (the browser). I do NOT have a terminal or curl or any other tools.

我创建了一个虚拟帐户,该帐户已链接到我的组织.我去了 https://github.com/settings/tokens 并添加了一个.

I created a dummy account that I linked to my org. I went to https://github.com/settings/tokens and added one.

然后我尝试了以下URL

Then I tried the following URLS

  • https://raw.githubusercontent.com/ORG/REPO/master/path/to/file.json?private_token=26cb4d8a30ca2
  • https://raw.githubusercontent.com/ORG/REPO/master/path/to/file.json?token=26cb4d8a30ca2

这不起作用.它似乎只与您在github gui上单击"raw"时获得的生成的令牌一起使用.不幸的是,该令牌很快过期,因此不适用于我的应用程序.

which does not work. It only seems to work with the generated token that you get when you click on "raw" on the github gui. Unfortunately this token expires quickly so it does not work for my application.

如何通过URL通过访问令牌访问github上的私有资源?

How do I access private resource on github with an access token through a URL ?

推荐答案

The API docs list that you can use the parameter access_token to pass in an oauth token (not private_token or token).

https://raw.githubusercontent .com/ORG/REPO/master/path/to/file.json?access_token = 26cb4d8a30ca2 为您工作吗?

这篇关于Github GET在带有访问令牌的私人仓库上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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