Search code examples
angulargoogle-signinlaminas-api-tools

Social Login from angular to backend (laminas api tool)


Can anyone point me out in the right direction?

I am trying to integrate google login to my angular project. My backend is in the laminas API tool framework.

This angular module looks good to achieve that. https://www.npmjs.com/package/angularx-social-login

As mentioned in that angular module, You can communicate the auth_token to your server to authenticate the user in server and make API calls from server.

I am trying to find the best approach to achieve this. How do I use auth_token in my backend?

Should I re-call to google with that auth_token from the backend to check if the user has been authorized? For me this doesn't look right, since to login a user I will have to make 2 API calls (from angular and backend) to google.


Solution

  • I ended up recalling google to verify the auth_token from API too. Anyone knows a better answer please add here, will accept.