navgurukul / ghar

0 stars 1 forks source link

Need to Authenticate the node Api #333

Open ujjwal15718 opened 3 months ago

ujjwal15718 commented 3 months ago

Ghar node API is publically accessible that can be controlled by us to authenticate the API

ujjwal15718 commented 3 months ago

Investigated the authentication-related work, every possibility is about storing the user data, Regarding this, the Postgresql database attached with our Ghar project locally and check whether the relation is successfully held or not by creating an API and testing it

ujjwal15718 commented 3 months ago

lastly, I read about the authentication process and I had some doubts that were mentioned on a doc and later coordinated with Vijay, today will continue on the authentication task and implement the PostgreSQL database in ghar with proper structure with an ORM that will help in the future during relation mapping And doing the possibilities to authenticate the api

ujjwal15718 commented 3 months ago

lastly implemented the database and wrote codes to directly deal with the database during table creation time with the help of Knex and update a few lines of code with JWT i.e JSON web token still continued on the API and think the approach where to integrate the API and to control web token related works

ujjwal15718 commented 3 months ago

created an API that is responsible for generating the token and a function that is responsible for knowing whether the token is valid or not authenticate an API i.e missingActivity, currently the token is reading from the header but need to know if API is authenticated, and then how to read the token when the API calling form Zoho

ujjwal15718 commented 3 months ago

I need to coordinate with someone from the team to know how to pass tokens from the Zoho side on headers Since the API is authenticated then I will push the changes by applying authentication on all three Moodle API Also, spend more time on node code to expiry-related work of the tokens

ujjwal15718 commented 3 months ago

push the changes into the dev server today, currently only one API is authenticated want to do a test with the API from zoho first then implement all the rest APIs And then make a function on Zoho that call the node API for token generation and that token will pass in the node API from Zoho

ujjwal15718 commented 3 months ago

the changes that were required to implement the database that is in the dev server now yesterday raised a PR and merged it later coordinated with Goldy to know the implementation process from the Zoho end is not completely done yet, I'll be continuing

ujjwal15718 commented 3 months ago

coordinated with Goldy and created a function that is responsible for calling node authentication API Later spent time on partner-related issues making the data from the database and providing it to the academic team continue on same task by authenticate all three moodle API and use it in dev server in Zoho Once we feel confident then will push into prod from node side and also from Zoho side

ujjwal15718 commented 3 months ago

The changes are ready but need to be reviewed from the Zoho side so I will probably push the changes today And then spend time controlling the generate token API under certain roles like admin or volunteer, which can be controlled by consulting with the team

ujjwal15718 commented 2 months ago

tested the changes in the dev server and merged the changes in production from both end Zoho and node, Also now planning to implement the admin control behaviour in node side For this still thinking and updating the codes locally

ujjwal15718 commented 2 months ago

filter the changes remove the un unnecessary lines of code and spend time on admission dashboard partner-related issues by helping team to check and varify the backend server logs and necessary apis log

ujjwal15718 commented 2 months ago

The authentication process is working in all the APIs of moodle Need to discuss today for close this or need to do more

ujjwal15718 commented 2 months ago

follow up the task with the academic team and then respond with what changes need to do also coordinate with ghar team for zoho changes

ujjwal15718 commented 2 months ago

Need to create documentation end to end, and I will spend time on to create a documentation that connect zoho too

ujjwal15718 commented 2 months ago

wrote the documents with the user flow and all the necessary points, today continue on this task after discussing it with Vijay

ujjwal15718 commented 2 months ago

coordinated with Vijay and discussed some points that were mentioned in docs Later wrote some lines of code in node APIs to control the api that is responsible for generating the token, changes are local currently. Today coordinate with someone who can help me to implement a few things on the zoho side then merge the necessary changes

ujjwal15718 commented 2 months ago

merged some necessary codes in the dev server of the node than after writing some code on zoho for design purposes took help from Varsa to know how to add menu and page-related works. Today I have some feedback to update a few things in zoho that I will coordinate with Varasa again and fix the issue also implement these changes in ghar app that we can push in prod today itself.

ujjwal15718 commented 2 months ago

updated some codes in zoho Review with Vijay and the team, Merge the changes into prod wrote a document, and attached a video to show how to generate and use token

ujjwal15718 commented 2 months ago

updated node code increase the expiry time of the token,latter coordinated with Jyoti Kajal that the error comes due to token was inserting with the key