DEV Community

mismathh
mismathh

Posted on

Implementing Alternative Authenticate Feature

As I continue on my open-source journey, I wanted to dive more into issues that revolved around JavaScript and Node.js, and preferably wanted to implement a new feature that I haven't implemented before. I found a project which I was interested in working on called Chat Application, which is a chat platform that allows users to send messages in newly created chat rooms and engage in conversations with others in real-time.

Issue

The issue is to implement an alternative authenticate feature that allows users to sign-in/log-in with their Google accounts. The issue can be found here.

Approach to Tackling the Issue

Authenticating with Google

The owner of the project stated that OAuth 2.0 needed to be used for the authentication, and so the first step to completing this issue is to understand how to integrate OAuth 2.0 authentication with Google for a Node.js server. A quick Google search led me to the use of Passport.js which I have been exposed to, so I plan start there and work my way up.

Front-end & Back-end Changes

Along with integrating OAuth 2.0, I'll need to update the back-end to handle the Google requests and authentication tokens and also store the relevant data. I'll also need to update the front-end to display the Google sign-in component so that users can actually use it.

Testing

Since this is a new feature that will be implemented, thorough testing will be required to ensure that it functions as expected. Over the past few months, I have been exposed to Jest and I'm quite fond of it, and so I plan to write some Jest tests that will test different scenarios.

Learning

Having only implemented custom local authenticate measures in my projects thus far, progressing with this issue presents an opportunity to explore different variations one can use for user authentication and will broaden my experience with OAuth 2.0.

Top comments (0)