Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility for auth #8

Open
NixBiks opened this issue May 21, 2019 · 5 comments
Open

Possibility for auth #8

NixBiks opened this issue May 21, 2019 · 5 comments

Comments

@NixBiks
Copy link

NixBiks commented May 21, 2019

Hi @ines

You make so awesome tools all the time. I love it! 😍

I have a paying client that wants me to do a one-day course in Python for them and thought it would be very cool to use this tool. Due to data privacy the course has to be private though. Is it possible to use a private gitlab repo and add auth to the course app?

I am quite new in this app space.

@ines
Copy link
Owner

ines commented May 21, 2019

Thanks! 😃 The Electron experiments I did the other day kind of go in a similar use case direction, but it's still a bit rough.

I think the easiest way might be to use a hosting provider that offers auth out-of-the-box? Netlify has this for instance: https://www.netlify.com/docs/identity/ I haven't used it myself, but like most of their features, it looks pretty straightforward.

You'd still need to host a public Binder, but that shouldn't be a problem, right? All you need is a GitHub repo with a requirements.txt that lists the Python dependencies you need.

@NixBiks
Copy link
Author

NixBiks commented May 21, 2019

Thanks for the response.

A public Binder. Wouldn't I need to upload the data to the Binder repo as well?

One other thing: what about plotting? Is that possible somehow?

@ines
Copy link
Owner

ines commented May 21, 2019

If you want to use data files and load them from the root of the user directory of the Python session, then yes, they need to be in the Binder. But you don't have to do that – you could just set up the Python environment there and then use requests to load an external file from somewhere. You could also use your own Jupyter server (example here). Something just needs to serve it.

Plotting should be possible, yes. It's a regular Jupyter environment, like a notebook.

@NixBiks
Copy link
Author

NixBiks commented May 22, 2019

Ah yes I needed %matplotlib inline as the first command.

Regarding auth I was looking for a solution with a login landing page before accessing the course site. But I get confused about all the graphql, gatsby etc since I am new to all these frameworks.

It might be that Netlify Identity is the solution but I don’t really see how to integrate that here. I’m sure it’s due to my rookie skills though.

Alternatively I was thinking of integrating redux and using that to keep track of whether or not a person has logged in or not (if not then route to login).

@ines
Copy link
Owner

ines commented May 22, 2019

It might be that Netlify Identity is the solution but I don’t really see how to integrate that here. I’m sure it’s due to my rookie skills though.

I think you host your page on Netlify, set it up and add that identity widget: https://github.com/netlify/netlify-identity-widget

Alternatively I was thinking of integrating redux and using that to keep track of whether or not a person has logged in or not (if not then route to login).

You could do that, but then you have to build the whole user authentication stuff yourself. This really sucks and probably isn't worth it? At least, it's definitely not something I would do.

You can also just host the built app somewhere and then set up a super basic server-side auth. Like this, if you're using nginx: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ It's not pretty and super rudimentary, but it's easy and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants