-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
3f91172
to
4a2d39f
Compare
backoffice/backoffice/users/views.py
Outdated
|
||
|
||
def user_login_success(request): | ||
refresh = RefreshToken.for_user(request.user) |
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.
wouldn't this fail if someone goes directly to login/success
and there is no user?
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.
indeed it should fail with a 403 Forbidden, instead an AnonymousUser
was being used that somehow could still access this route without any problem
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.
minor comment
backoffice/backoffice/users/urls.py
Outdated
@@ -11,4 +12,5 @@ | |||
path("~redirect/", view=user_redirect_view, name="redirect"), | |||
path("~update/", view=user_update_view, name="update"), | |||
path("<int:pk>/", view=user_detail_view, name="detail"), | |||
path("login/success/", user_login_success, name="login_success"), |
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.
@DonHaul can we rename this as /me
and @karolina-siemieniuk-morawska could integrate it in her PR. This will be similar to hep, user is logged in to orcid and UI check it's status from there.
Diagram of wanted workflow
To do:
Notes & links 2024/09/18
|
|
Currently trying an implementation with only Managed to find the path to authenticate - https://docs.allauth.org/en/latest/headless/openapi-specification/#tag/Authentication:-Providers/paths/~1_allauth~1browser~1v1~1auth~1provider~1redirect/post - it returns a code - althought it seems its not fully doing his job since when I try to get the user via https://docs.allauth.org/en/latest/headless/openapi-specification/#tag/Authentication:-Current-Session I get 401 meaning authentication has not been completely done. Next Actions: JWT Token seems to not be implemented by default - token strategy must be implemented, or use dj-rest-auth. I've figured the auth workflow that must be followed (using
Now implementing it using |
Facts:
Next Steps:
|
Possible Implementations: Trying option b) Only solution - Create a custom callback view |
2b6263f
to
a2fc9bf
Compare
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.
Thanks @DonHaul just the comment and could you please change a bit the commit message? Something like:
backoffice: Addition of headless `allauth` for ORCID login
5059629
to
22398a5
Compare
@DonHaul there is a conflict here with poetry |
22398a5
to
b05072b
Compare
b05072b
to
b0bc197
Compare
Fixes #509