Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Tutorials
Tutorials
Explore in-depth tutorials for operating your VTEX store.
Tutorials
Authentication
Authentication basics
Adding a Client Id and a Client Secret to log in with Google
Adding a Client Id and a Client Secret to log in with Google

To activate Google login with OAuth2, you must access the VTEX ID in your admin and fill in the Client ID and Client Secret fields, as described in this article.

{"base64":"  ","img":{"width":2026,"height":1176,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":75951,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_1.png"}}

These values are derived from a project that needs to be created in the Google Cloud Platform API service.

To get these values, do the following:

The steps mentioned below describe a third-party platform and may therefore be outdated. For the latest information related to these steps, please access the following Google articles: Setting up OAuth 2.0 and OpenID Connect.

  1. Access the link https://console.developers.google.com/;

  2. In the side tab, click on Credentials;

  3. Click on Create Project;

    {"base64":"  ","img":{"width":1900,"height":337,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":32691,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_2.png"}}

  4. Name the project and click on Create;

    {"base64":"  ","img":{"width":523,"height":351,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":24207,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_3.png"}}

  5. Click on Create credentials;

    {"base64":"  ","img":{"width":428,"height":41,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":3287,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_4.png"}}

  6. Select the OAuth client ID option;

    {"base64":"  ","img":{"width":446,"height":273,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":23348,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_5.png"}}

  7. Click on Configure consent screen;

    {"base64":"  ","img":{"width":571,"height":216,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":20962,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_6.png"}}

  8. Choose the type of user for your store(Internal or External) and click on Create;

    {"base64":"  ","img":{"width":485,"height":386,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":29445,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_7.png"}}

  9. Application name: will be shown to clients when logging in;

  10. User support email: for users to contact you with question about their consent;

  11. App logo: corresponds to your store logo;

  12. Authorized Domains: domains that may interact with this API should be included. These should be, at least, the domain of your store and the VTEX domain:

    • store.com, as the example, always without "www" or its equivalent
    • vtex.com.br, regarding our backend servers
  13. Developer contact information: these email addresses are for Google to notify you about any changes to your project;

  14. Click on Save and continue;

    {"base64":"  ","img":{"width":585,"height":1464,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":168139,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_8.png"}}

  15. In the left side menu, click on Credentials;

  16. In Type of application, click on Web Application;

    {"base64":"  ","img":{"width":790,"height":411,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":37568,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_9.png"}}

  17. Name: for internal identification;

  18. Authorized JavaScript origins: add the exact addresses that can use this authentication method, corresponding to your site; for example https://www.mystore.com. We also recommended that you add the address https://{{accountName}}}.myvtex.com of your account, where {{accountName}} is your account name as described in the store's admin menu;

  19. Authorized redirect URIs: add the VTEX service URL: -https://vtexid.vtex.com.br/VtexIdAuthSiteKnockout/ReceiveAuthorizationCode.ashx

    {"base64":"  ","img":{"width":549,"height":773,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":53610,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_10.png"}}

  20. After you complete these steps, your credentials will be displayed:

    {"base64":"  ","img":{"width":469,"height":401,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":30745,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_11.png"}}

    • Copy the Client ID from Google and paste it into the `Client Id' field in the VTEX ID admin.
    • Copy the client secret key from Google and paste it into the Client Secret field in the VTEX ID admin.
      {"base64":"  ","img":{"width":2026,"height":1176,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":75951,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Authentication/Authentication%20basics/adding-a-client-id-and-a-client-secret-to-log-in-with-google_12.png"}}

      Then, save the changes.
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback