AuthPack | Demonstration Project for Authentication with Major Social | Authentication library
kandi X-RAY | AuthPack Summary
kandi X-RAY | AuthPack Summary
Demonstration Project for Authentication with Major Social Services
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AuthPack
AuthPack Key Features
AuthPack Examples and Code Snippets
Community Discussions
Trending Discussions on AuthPack
QUESTION
I'm using a Express Nodejs backend + React frontend set up and tried to implement a "Register / Signin with Google" function, but I do not understand what to store in the database after the user is authenticated. In the ordinary register with email approach, I send the email + password to the backend when I register and check if both the email & password match when the user login.
However, I don't know what to store in the db if one is registered with Google. I have already implement part of the google auth with google by following this tutorial in the frontend side, here's my code:
...ANSWER
Answered 2020-Feb-19 at 10:06What you need to save is user's unique id, his email or phone, and some other user data for your project. This is just to know if the user already registered or to know the current user in backend.
From backend, you can just set a middleware to verify the token assigned from google. Then you will get the user's id and you can find a user from your database, if exists, the user is authenticated.
- Signin with google.
- Get redirected with CODE
- Send CODE to backend
- Backend will get user id and email with the CODE using google api.
- Save user and generate token.
- Send the token back to your frontend.
- Then the login or signup process is finished.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AuthPack
Important: Update Web.config with service provider authentication keys and secrets.
Site.Master - Contains most HTML/Javascript modifications.
/Auth - Most of the custom code resides here. Auth.aspx.cs contains sample oAuth calls for each provider.
Register your application with the service providers and retrieve the necesseary API keys. Then enter them in web.config.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page