I have an application where a user logs in via oauth, i have access to the user's github access_token
.
I want to be able to render a private repository image to html, using the users access_token or something i can obtain via the access_token?
for exmaple
https://raw.githubusercontent.com/MyORG/my-private-repo/master/architecture.drawio.png?token=<UNKNOWN_TOKEN>
react render componetn
<img src="https://raw.githubusercontent.com/MyORG/my-private-repo/master/architecture.drawio.png?token=<UNKNOWN_TOKEN>" alt="image-service">
I have tried using the access_token
in place of this UNKNOWN_TOKEN
but it does not work.
I am able to curl the image, but i need the image to be rendered via a html tag at run time.
curl -X GET -H "Authorization: token <ACCESS_TOKEN>" https://raw.githubusercontent.com/MyORG/iy-private-repo/master/architecture.drawio.png --output some.pnpg
I am attemtping to render README.md to a custom react/nextjs web page. However their are image links within the README.md which are not rendered because they require auth.
I get the initial README.md via https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28