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

[Auth] Allow users to login and logout #22

Open
terrameijar opened this issue Sep 29, 2023 · 5 comments
Open

[Auth] Allow users to login and logout #22

terrameijar opened this issue Sep 29, 2023 · 5 comments

Comments

@terrameijar
Copy link
Collaborator

Users should have the ability to log in and out of the website. The backend has this functionality ready and the API endpoints for auth are api-auth/login/ and api-auth/logout. The backend currently supports basic HTTP username and password authentication.

@IamTyrone let's start with basic HTTP authentication to get the ball rolling and move to something else like server-side tokens or JWT later. What do you think?

CC @mpumzee , do you have any thoughts on auth?

@terrameijar terrameijar added this to the Initial Go-Live milestone Sep 29, 2023
@maunga-et
Copy link
Collaborator

I suggest that we start with token based auth. I want to work on his ticket.

@terrameijar
Copy link
Collaborator Author

@maunga-et thanks. If I remember correctly, work on this has been started and the auth currently uses HTTP auth.

Do you mind explaining why you're suggesting we go with token auth and how you would implement it?

@IamTyrone
Copy link
Contributor

@terrameijar He is mentioning token-based authentication because HTTP auth will authenticate DRF's browsable API but will not authenticate the API endpoints for a different origin. It is not possible to authenticate the API endpoints from a different client other than the browsable API via HTTP Auth.

If @maunga-et however, wants to implement token authentication, he should implement 2 endpoints that authenticate a mobile client via Authorization headers and another for web clients(React) via HTTP only cookies.

@maunga-et
Copy link
Collaborator

@terrameijar it makes it easy to integrate with our clients(web and mobile) and also serves to protect private endpoints. We can use simplejwt for that.

@terrameijar
Copy link
Collaborator Author

@maunga-et , I missed your comment above, let's go with token auth, please work on this

@terrameijar He is mentioning token-based authentication because HTTP auth will authenticate DRF's browsable API but will not authenticate the API endpoints for a different origin. It is not possible to authenticate the API endpoints from a different client other than the browsable API via HTTP Auth.

If @maunga-et however, wants to implement token authentication, he should implement 2 endpoints that authenticate a mobile client via Authorization headers and another for web clients(React) via HTTP only cookies.

@IamTyrone makes sense, thank you.

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

No branches or pull requests

3 participants