WIX members and profiles. Get the token from Google Authentication

Hi,

I recently added a login page to my wix site as shown below. So users can authenticate through google, I want to get the auth token from that google authentication process to then send that token to my API which works with Google authentication. So basically I need to authenticate the user to my API, once they logged once to members page in WIX.

Do somebody knows how to do this?

You are showing the Wix Editor settings for when you have added the Wix Members app to your site.
https://support.wix.com/en/article/adding-a-members-area-to-your-site

You actually have three ways of signup or login with Wix with Wix Default, Custom or Corvid as shown here on this page.
https://support.wix.com/en/article/about-the-member-signup-form

Note that you will only get the social buttons for Google etc with the default option, if you want to try adding it to your own Corvid lightbox then see this previous forum posts here.
https://www.wix.com/corvid/forum/community-discussion/solution-google-facebook-user-information-on-login
https://www.wix.com/corvid/forum/community-discussion/custom-registration-google

As for getting the tokens for Google Auth etc, then have a look at previous forum posts as this has been asked before in the forum like here.
https://www.wix.com/corvid/forum/community-discussion/google-identity-platform-oauth-2
https://www.wix.com/corvid/forum/community-discussion/google-client-api-oauth2-rawabi

Finally, you can see it already setup in examples like here as Gal mentions in the last post linked above too.
https://www.wix.com/corvid/forum/community-discussion/example-google-sheets-npm

1 Like

Thank you very much GOS, your answer helped me a lot. But now I have a few questions, I’ve already implemented the custom google sign in button, I’m recieving a token then I send that token to my external API service, the API service authenticates the user and returns a cookie with an ID session.

  1. How can I use that cookie through all my wix site?
  2. How can I redirect the user to wix members page once logged in?

Below you can find the set-cookie response header that my API service returns when the user was successfully authenticated.