-
Notifications
You must be signed in to change notification settings - Fork 30
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
Login page #75
Login page #75
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
451abfd
to
c680581
Compare
It works on my side. You need to pass your jupyverse --authenticator.client_id=my_client_id --authenticator.client_secret=my_client_secret |
Thanks, @davidbrochart! I was using the |
It should work too. |
How do the token works? How can I redirect the user to /lab adding the token provided by the user? |
I have the correct callback URL, and it fails. |
This comment has been minimized.
This comment has been minimized.
Tests are failing because instead of returning 404 when the user doesn't have permissions, we redirect to the logging page, which returns a 200. |
Changed test to check if the server returns an HTML page instead of the 404. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great @hbcarlos !
On thing though, anonymous login doesn't seem to work for me (no effect when clicking), but maybe it's for a next PR?
I can take a look at anonymous login on this PR too, should be an easy fix. |
Regarding the anonymous login, when using the flag |
Yes, that's the expected behavior.
That's because we first have to register the anonymous user. |
Oooh, got it. I'll implement it on this PR. |
59d2e60
to
f3d547e
Compare
I've been looking into the anonymous user, and I don't think it is the right approach to the problem. |
Yes, the system is user-based, even if it's not a "real" user. The token user is also a user, with a token as his ID.
But then other users won't be able to "see" anonymous users? For me, an anonymous user is just a regular user (maybe with less permissions) who didn't want to bother registering himself. There is no reason for him not to be in the database. |
Thanks, @davidbrochart. You are right. Can we merge this PR and open a new one to tackle the role-based access control? That would make it much easier to know what every user can do. |
Since there are quite a lot of changes in this last commit, could you explain a bit? |
Yes, yes. It would be best to chat and show you the code because I changed everything even though it was fine. Sorry for that. |
Sure, but it's also nice to have it written here, even a summary. At a high-level, what are you trying to achieve? |
Okay, I'll write it tomorrow. I need to do some more changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC both noauth
and token
authentication modes use the same "guest user"? I like that because it solves the settings persistence issue mentioned in #61 (comment).
I'm not sure why the Check release is failing.
|
cf6cee4
to
f9da6da
Compare
The test in windows fails because we use |
We don't install |
Thanks, @davidbrochart! It is still missing the check release test that I don't know why it is failing. |
I think we can ignore that, as |
What is missing to merge this PR and continue with Authorization? |
The CI failure is caused by FPS master, see jupyter-server/fps#49. |
tests/test_auth.py
Outdated
expected = 200 | ||
content_type = "text/html; charset=utf-8" | ||
if auth_mode in ["token", "user"]: | ||
expected = 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to return a 401
when no login plugin is installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that depends on auth_config.login_url
if it exists, will always redirect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that's the responsibility of the user, if they set a login_url
without installing a login plugin, it's a 404
, otherwise it's a 401
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the login_url
is in fps_auth
config and defaults to /login
. Is there a way to default to None
and then the fps_login
plugin modifies the auth_config
to set the desired URL?
…ccording to the new behaviour
Thanks @hbcarlos ! |
Added a new plugin that registers a new endpoint for the login page.
The login page has three ways of login, GitHub, token or anonymous.
The GitHub login throws a server error when redirecting, looks like the error comes from FastAPI Users when it tries to retrieve the user information from GitHub. I'll debug tomorrow.
Regarding the login with the token, I'm not sure how it works.