cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
pauldeen
Level VI

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?

6 REPLIES 6
jthi
Super User

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)

jthi_0-1721745945054.png

 

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

-Jarmo

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.

pauldeen
Level VI

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.

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:


https://community.jmp.com/t5/JMP-Scripts/Integrating-Google-Drive-with-JMP-using-HTTP-Request/ta-p/5...


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.

pauldeen
Level VI

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 I'll keep trying and report back if I figure it out.

jthi
Super User

Re: Open file from private github repository (authentication needed)

I think Open() might not be able to utilize the stored session.

-Jarmo