- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Open file from private github repository (authentication needed)
I would like to open a jmp table stored on github in a private repository (that my user account has access to). So how do I web open a file that needs authentication?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
I think you might be able to store the session using
web("https://github.com/", JMP Window)
and logging in. Then you might be able to just use Open on the URL.
Open("https://community.jmp.com/kvoqx44227/attachments/kvoqx44227/sample-data/118/1/How%20Domestic%20Is%20My%20Car.jmp")
I think you can also do it interactively (not sure if this is recorded)
Other option is to look into github's documentation (maybe https://docs.github.com/en/apps) and utilize New HTTP Request as needed (I would go this route)
Ediit: Most likely better documentation GitHub REST API documentation - GitHub Docs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
I wrote and example and stored it on GitHub a while back.
https://github.com/bryanboone-jmp/HTTP-Request-with-githib/blob/main/github.jsl
This uses Basic authorization.
I referenced the original location I used while creating the JSL
https://gist.github.com/joyrexus/85bf6b02979d8a7b0308
The JSL itself references:
user = "bryanboone-jmp";
repository = "HTTP-Request-with-githib";
which is my github location itself, so you'll want to change it.
It just does some basic stuff, so feel free to reach out if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
Thanks Bryan but this one fails. I think most likely because I have 2FA turned on. So I need to investigate how to build a similar thing with the API's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
You can do 2 factor authentication (really OAuth2) with JMP JSL.
Check out the example in the scripting index under
Get Authorization Header
It basically centers around
New OAuth2
There's also an example in the community:
I haven't done one for GitHub, but I have for Google/Azure.
The server is in complete control, so if your registration has MFA (or not), JMP just follows redirects.
The Azure one may be disabled for your site. Mine is disabled here due to admin settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
Thanks Jarmo, It does allow me to log-in and store the session but I do not seem to be able to open a data table directly. It might be the link to the file (I tried raw and web path). The one you shared is from the JMP community so it is a little different
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Open file from private github repository (authentication needed)
I think Open() might not be able to utilize the stored session.