Community-Website icon indicating copy to clipboard operation
Community-Website copied to clipboard

Google Auth on Admin login page

Open SaurabhS55 opened this issue 1 year ago β€’ 11 comments

Hey there, It will more user friendly, if we add "Login with Google" button in admin login page. Can we add "Login with Google" button? I would like to work on this feature. could you assign this feature to me under GSSOC'24 label ?

To implement this we gone make use of React OAuth2 NPM library which provides built in support for google Authentication.

SaurabhS55 avatar May 17 '24 19:05 SaurabhS55

Hello there!πŸ‘‹ Welcome to the project!πŸš€βš‘

Thank you and congratsπŸŽ‰ for opening your very first issue in this project. Community-website aims to build a resource sharing platform in order to reduce the knowledge gap. Please adhere to our Code of Conduct.πŸ™Œ If you have screenshots or a gif to share demonstrating the issue, that's really helpful!πŸ“Έ Please make sure not to start working on the issue, unless you get assigned to it.πŸ˜„

Feel free to join our Slack Community.πŸ’– We have different channels for active discussions.✨ Hope you have a great time there!πŸ˜„

welcome[bot] avatar May 17 '24 19:05 welcome[bot]

hmm, sounds interesting, but can't it allow anyone to login? We need to have a check that only the admins, whose data is in our database, should be allowed to signin using Google. Please make sure to add this check, else the whole admin purpose will be defined

Kajol-Kumari avatar May 18 '24 05:05 Kajol-Kumari

Yes we can do this by adding check in controller functions.

SaurabhS55 avatar May 18 '24 07:05 SaurabhS55

@SaurabhS55 please go ahead with this issue :)

Kajol-Kumari avatar May 18 '24 07:05 Kajol-Kumari

Hi, if this issue is not worked on yet, I would like to take this up. @Kajol-Kumari

Likhita4403 avatar Jun 09 '24 03:06 Likhita4403

Hi @Kajol-Kumari , for the google based authentication, we would need to create an api client id and such, do you have a gmail account whose credentials I could use

Likhita4403 avatar Jun 13 '24 02:06 Likhita4403

Hey @Likhita4403 please use a dummy email for this and share the onboarding step in pr as well, i can't share the email creds wiith u so will create the required things myself by following the steps you will mention

Kajol-Kumari avatar Jun 13 '24 12:06 Kajol-Kumari

Steps:

  1. Get a Google API Client ID:
  • Go to the Google API Console Credentials page.
  • Create or select a Google APIs project.
  • Click Create credentials > OAuth client ID and choose Web application.
  • Add your website's URI to Authorized JavaScript origins.
  1. Configure OAuth Consent Screen:
  • Go to the OAuth consent screen page in the Google Developer Console.
  • Fill out the required information (application name, logo, support email, etc.).
  • Define the necessary scopes for the data your application needs to access.
  • Add authorized domains and links to your application's homepage, privacy policy, and terms of service.
  • Submit your application for verification if required.
  1. Implement Sign In with Google on Your Website:
  • Use the Google Identity Services library to add the Sign In button to your admin login page.
  • Handle the user authentication flow and retrieve the ID token.
  • Verify the ID token on your backend to ensure its authenticity.
  • Check if the authenticated user is an admin based on your admin user management system.

These steps need to be followed, please check and let me know once you are done with the required steps from your side.

Likhita4403 avatar Jun 16 '24 06:06 Likhita4403

@Likhita4403 i will only get pt1 done, i hope u understand that i wouldn't solve the whole issue on your behalf

Kajol-Kumari avatar Jun 16 '24 13:06 Kajol-Kumari

Yeah I know, let me know the details once the part 1 is completed

Likhita4403 avatar Jun 16 '24 14:06 Likhita4403

@Likhita4403 pt1 and 2 is done but again i can't share u the id and secret, once u raise the pr, i will test the chane using the same

Kajol-Kumari avatar Jun 17 '24 10:06 Kajol-Kumari

Hey @Kajol-Kumari

Assign me the issue...

I'm interested to add Sign In with Google functionality using Firebase Authentication

BHS-Harish avatar Jul 26 '24 15:07 BHS-Harish

not needed for now, so closing it

Kajol-Kumari avatar Jul 26 '24 18:07 Kajol-Kumari