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

[FEATURE] Login and Logout using JWT and OAuth 2.0 #29

Open
1 task done
ajaynegi45 opened this issue Sep 5, 2024 · 8 comments
Open
1 task done

[FEATURE] Login and Logout using JWT and OAuth 2.0 #29

ajaynegi45 opened this issue Sep 5, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request gssoc GirlScript Summer Of Code gssoc-ext hacktoberfest hacktoberfest-accepted level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)

Comments

@ajaynegi45
Copy link
Owner

ajaynegi45 commented Sep 5, 2024

Is this feature already requested?

  • I have checked "open" and "closed" issues, and this is not a duplicate.

Feature Description

Description:

Implement secure login and logout functionality using JWT and OAuth 2.0 in our library management system. The feature should ensure proper role-based access control (RBAC) for different user roles (ADMIN, LIBRARIAN, USER).

The frontend is built using React, so the solution must be compatible with the existing codebase. frontend Security issue

Fork security branch

Requirements:

  1. Authentication Mechanism:

    • Implement JWT-based authentication for handling login and logout.
    • Integrate OAuth 2.0 to allow users to authenticate through third-party providers.
  2. Role-Based Access Control (RBAC):

    • Implement role checking to restrict access to certain functionalities based on the user's role.
    • Example: Only admins should have access add LIBRARIAN and many more
  3. Frontend Integration (React):

    • Ensure that the login and logout functionality integrates seamlessly with the existing React frontend.
    • The frontend should be able to securely store the JWT token and manage user sessions.
  4. Security Considerations:

    • Implement token expiration and refresh logic for maintaining secure sessions.
    • Ensure logout functionality invalidates the JWT token on both the client and server.
    • Protect sensitive routes by ensuring only authenticated users with the proper roles can access them.
  5. API Endpoints:

    • Define the necessary API endpoints for login and logout in the backend (Spring Boot).
    • Ensure the endpoints return appropriate HTTP status codes and messages.
@ajaynegi45 ajaynegi45 added status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) enhancement New feature or request hacktoberfest-accepted hacktoberfest status: ready for dev You can asked for this issue to be assigned (if not already assigned) and removed status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) labels Sep 5, 2024
@rishabhrawat05
Copy link
Contributor

Hi! @ajaynegi45
Can you please assign this issue to me. I can help you with the secure login and logout functionality

@ajaynegi45 ajaynegi45 added the gssoc GirlScript Summer Of Code label Oct 1, 2024
@ajaynegi45
Copy link
Owner Author

Hi! @ajaynegi45 Can you please assign this issue to me. I can help you with the secure login and logout functionality

Hi @rishabhrawat05,

Thank you for expressing your interest in working on the "Login and Logout using JWT and OAuth 2.0" issue. I'm delighted to inform you that I have assigned this issue to you. Your willingness to contribute to our project is much appreciated.

Feel free to start working, and if you have any questions or need assistance during the process, please don't hesitate to reach out.

@ajaynegi45 ajaynegi45 added level3 GirlScript Summer Of Code - 35 points gssoc-ext labels Oct 2, 2024
@rishabhrawat05
Copy link
Contributor

rishabhrawat05 commented Oct 3, 2024

Hey @ajaynegi45
Here are the updates of the project

  1. Jwt Authentication is completed
  2. working on role based and OAuth2

Here are some screenshots
Screenshot (191)
Screenshot (192)

@ajaynegi45
Copy link
Owner Author

Hey @ajaynegi45 Here are the updates of the project

  1. Jwt Authentication is completed
  2. working on role based and OAuth2

Here are some screenshots Screenshot (191) Screenshot (192)

Also Add username.

@rishabhrawat05
Copy link
Contributor

Hey! @ajaynegi45
I have implemented Oauth2 security also and moving forward with role-based and frontend implementation, So can you provide a brief about which role to assign to which services/API, because it is not mentioned above.

@ajaynegi45
Copy link
Owner Author

"ADMIN and LIBRARIAN roles will have full access to all APIs. The USER role, however, will have restricted access. Specifically, the USER role does not have permission to access the following APIs:

  • addBook
  • updateBook
  • deleteBook
  • getAllBorrowings
  • getSingleBorrowingById
  • getAllMembers
  • getMemberById

If there are any other endpoints that require role-based access, feel free to reach out!"

@rishabhrawat05
Copy link
Contributor

Hi! @ajaynegi45
I have implemented role-based authentication and would like to ask you if I should add, deleteMember API also authenticated to admin and librarian or keep it just like that.

@ajaynegi45
Copy link
Owner Author

Hi! @ajaynegi45 I have implemented role-based authentication and would like to ask you if I should add, deleteMember API also authenticated to admin and librarian or keep it just like that.

update that also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc GirlScript Summer Of Code gssoc-ext hacktoberfest hacktoberfest-accepted level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
Development

No branches or pull requests

2 participants