Rajat2024 / NoteBook

Here notebook is created using React as a frontend and NodeJS as a backend. Here you can add , delete and update notes in your Mongoose database. You create a password using express validation , authentication using JWT Token and salting. An easy way to sign up and log in a notebook, context for data passing through the component.
https://mern-notebook.onrender.com/
0 stars 1 forks source link

[Feature] Implemented Google Account authentication for the application. #147

Closed Santosh7017 closed 1 year ago

Santosh7017 commented 1 year ago

This pull request belong to issue no. #111 and introduces the implementation of enhanced authentication functionality by integrating Google Account authentication. With this update, users will be able to securely authenticate and access the application using their Google Account credentials, providing an additional layer of authentication and simplifying the login process. This feature enhances the security and user experience of the application, ensuring reliable and convenient access for all users. The changes made in this pull request effectively enhance the overall authentication system, thereby strengthening the security and usability of the application.

Do's after cloning

Rajat2024 commented 1 year ago

CLIENT_ID = "" // OAuth client ID CLIENT_SECRET = "" // OAuth client secret successURL = "" // this URL will redirect user to the page where we want send him after succesfull authentication CALLBACK_URL = "" // callback url like http://localhost:5000/auth/google/callback

please tell what is to write in this

Santosh7017 commented 1 year ago

CLIENT_ID = "" // OAuth client ID CLIENT_SECRET = "" // OAuth client secret successURL = "" // this URL will redirect user to the page where we want send him after succesfull authentication CALLBACK_URL = "" // callback url like http://localhost:5000/auth/google/callback

please tell what is to write in this

To create a Google OAuth client ID and client secret, you need to follow the steps below:

Go to the Google Cloud Console: Visit the Google Cloud Console at https://console.cloud.google.com/ and sign in with your Google account.

Create a new project: If you don't have a project yet, create a new project by clicking on the project drop-down menu at the top of the page and selecting "New Project". Give your project a name and click "Create".

Enable the necessary APIs: In the Cloud Console, go to the "APIs & Services" section. Click on "Library" in the left-hand menu. Search for and enable the following APIs:

Google OAuth 2.0 API Google+ API (if needed) Set up OAuth consent screen: In the Cloud Console, navigate to the "APIs & Services" section and click on "OAuth consent screen" in the left-hand menu. Choose an appropriate user type and fill in the required information, such as the application name and authorized domains.

Create OAuth client ID: In the Cloud Console, go to the "APIs & Services" section and click on "Credentials" in the left-hand menu. Click on the "Create Credentials" button and select "OAuth client ID" from the drop-down menu.

Configure the OAuth client ID: Choose the application type, such as "Web application" or "Android/iOS app". Enter the necessary details, including authorized JavaScript origins or redirect URIs, depending on your application type. Save the configuration.

Obtain the client ID and client secret: Once you've created the OAuth client ID, the client ID and client secret will be displayed on the "Credentials" page. Make sure to copy and securely store these values as they are required for authenticating your application

then store these values in .env file CLIENT_ID = "" // OAuth client ID CLIENT_SECRET = "" // OAuth client secret CALLBACK_URL = "" // callback URL like (http://localhost:5000/auth/google/callback) in place of localhost put the live server's link where you will receive callback successURL = "" // this URL will redirect user to the page where we want send him after succesfull authentication for example Home page URL(https://mern-notebook.onrender.com/)