> ## Documentation Index
> Fetch the complete documentation index at: https://doc.omnitechsolucoes.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuração do App Google

> Guia para configurar um aplicativo Google e permitir login/cadastro via Google na sua plataforma OmniTech IA

Este documento fornece instruções para configurar um aplicativo no Google Cloud e permitir que usuários façam **login ou cadastro via Google** na sua plataforma **OmniTech IA White Label**.

## Habilitando APIs e Registro do Aplicativo

Para permitir que usuários façam login utilizando suas contas Google, é necessário criar um projeto no **Google Cloud Platform** e configurar o OAuth.\
Siga os passos abaixo para criar e configurar corretamente o seu projeto.

## 1. Acessar o Google Cloud Platform

Acesse [https://console.cloud.google.com/](https://console.cloud.google.com/) e faça login para entrar no console do Google Cloud.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/QFyKmlcCEDLaKT5-/resources/white-label-google-login-page.png?fit=max&auto=format&n=QFyKmlcCEDLaKT5-&q=85&s=c4e88a6ccf1625fd54db1ee5979cd7bc" alt="Login no Google Cloud Console" width="550" height="581" data-path="resources/white-label-google-login-page.png" />
</Frame>

## 2. Criar um projeto

Clique no seletor de projetos no menu superior. Na janela **Selecionar um projeto**, clique em **NOVO PROJETO**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-create-project.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=197a17127ef333d85dbeeb65e391c986" alt="Criar Projeto no Google Cloud" width="938" height="934" data-path="resources/google-create-project.png" />
</Frame>

Informe o **Nome do projeto** e clique em **CRIAR**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-project-name.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=2351dd89f1004dad09b1b4b09b3af648" alt="Nome do Projeto no Google Cloud" width="937" height="563" data-path="resources/google-project-name.png" />
</Frame>

## 3. Configurar a Tela de Consentimento OAuth

Após a criação do projeto, acesse **APIs e Serviços**.\
No menu lateral, selecione **Credenciais** e clique em **CONFIGURAR TELA DE CONSENTIMENTO**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-credentials.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=5d4011ebe6c36b13f8cb21f1ce6071a5" alt="Credenciais do Google" width="1144" height="564" data-path="resources/google-credentials.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-credentials2.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=6a7da90c585eb45ccb6303392c477254" alt="Credenciais do Google" width="1144" height="490" data-path="resources/google-credentials2.png" />
</Frame>

Escolha o tipo de usuário **Externo** e clique em **CRIAR**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-create-button.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=4ae38528a5bbb846cb23cb04ce1f6eea" alt="Criar Tela de Consentimento" width="1144" height="638" data-path="resources/google-create-button.png" />
</Frame>

## 4. Editar o Registro do Aplicativo

### 4.1 Tela de Consentimento OAuth

Preencha os seguintes campos:

* **Nome do aplicativo**
* **E-mail de suporte**
* **Logotipo do aplicativo**

Informe também:

* **Página inicial do aplicativo**
* **Link da política de privacidade**
* **Link dos termos de uso**
* **Domínio do site**
* **E-mails de contato**

Clique em **SALVAR E CONTINUAR** para avançar.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-edit-registration.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=1d6ca74e145ca25920d33b07e06581cb" alt="Editar Registro do Aplicativo" width="937" height="2122" data-path="resources/google-edit-registration.png" />
</Frame>

### 4.2 Escopos (Scopes)

Na etapa **Escopos**, clique em **ADICIONAR OU REMOVER ESCOPOS**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-add-remove-scopes.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=6915d003dfd1ee044cdf0a3df4a7817b" alt="Adicionar ou Remover Escopos" width="937" height="477" data-path="resources/google-add-remove-scopes.png" />
</Frame>

Selecione os três escopos obrigatórios:

* **.../auth/userinfo.email**
* **.../auth/userinfo.profile**
* **openid**

Após selecionar, clique em **ATUALIZAR**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-required-api-scopes.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=038f44bfdb743502942c6ff4912c7eee" alt="Escopos de API Obrigatórios" width="1212" height="1102" data-path="resources/google-required-api-scopes.png" />
</Frame>

Os escopos selecionados aparecerão na seção **Escopos não sensíveis**.\
Clique em **SALVAR E CONTINUAR** para avançar.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-sensitive-scopes-section.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=de2d2326da58e16153801d4c8877c974" alt="Escopos Sensíveis" width="937" height="1461" data-path="resources/google-sensitive-scopes-section.png" />
</Frame>

### 4.3 Usuários de Teste

Na etapa **Usuários de teste**, você pode adicionar contas para testar o login social ou simplesmente clicar em **SALVAR E CONTINUAR**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-test-users.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=5af1c8c380bdadf9d30aaa2037266580" alt="Usuários de Teste do Google" width="937" height="736" data-path="resources/google-test-users.png" />
</Frame>

### 4.4 Resumo

Na etapa **Resumo**, revise as informações do aplicativo e clique em **VOLTAR AO PAINEL**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-summary.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=06a3f47bae0b30662530204b5676e34b" alt="Resumo do Aplicativo" width="939" height="2017" data-path="resources/google-summary.png" />
</Frame>

## 5. Criar Credenciais OAuth

No menu lateral, selecione **Credenciais**.\
Clique em **CRIAR CREDENCIAIS** e escolha **ID do cliente OAuth**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-create-credentials.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=a1aafd481ab57c9c7927896e9eb1244a" alt="Criar Credenciais OAuth" width="1211" height="498" data-path="resources/google-create-credentials.png" />
</Frame>

Na tela **Criar ID do cliente OAuth**:

* Selecione **Aplicativo da Web**
* Informe um nome para o cliente OAuth

No campo **URIs de redirecionamento autorizados**, informe a URL de callback.

**Exemplo:**

* `https://seudominio.com/login/google/callback`

<Note>
  Por padrão, as URLs podem conter "/" no final. Remova a barra final caso sua aplicação não utilize esse padrão.
</Note>

Clique em **CRIAR**.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-create-oauth-client.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=9e97700dff0213e95c3d5ab1de03efaf" alt="Criar Cliente OAuth" width="937" height="1370" data-path="resources/google-create-oauth-client.png" />
</Frame>

## 6. Inserir as Chaves na OmniTech IA

Após a criação, será exibido o pop-up **Cliente OAuth criado**, contendo:

* **Client ID**
* **Client Secret**

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-oauth-client-created.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=46784a37c470e3cc29f6463a274c8a73" alt="Cliente OAuth Criado" width="916" height="843" data-path="resources/google-oauth-client-created.png" />
</Frame>

Copie essas chaves e cole nos campos correspondentes em:\
**White Label → Configurações → Logins Sociais → Google**

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/QFyKmlcCEDLaKT5-/resources/white-label-google-configuration.png?fit=max&auto=format&n=QFyKmlcCEDLaKT5-&q=85&s=4f2359605acf50e3a0ba2667df0078a3" alt="Configuração Google na OmniTech IA" width="1526" height="546" data-path="resources/white-label-google-configuration.png" />
</Frame>

## Testes

Teste o login social nas páginas de **Login** e **Cadastro**.\
Caso encontre qualquer problema, revise os passos ou entre em contato com o suporte.

<Frame>
  <img src="https://mintcdn.com/omnitech-a4248806/06iazWsGpw98tpwL/resources/google-test.png?fit=max&auto=format&n=06iazWsGpw98tpwL&q=85&s=d9a4c5673f1759b4be903159e8a865a3" alt="Teste de Login com Google" width="594" height="653" data-path="resources/google-test.png" />
</Frame>

***

**Precisa de ajuda?**\
Entre em contato com o suporte da **OmniTech IA** para auxílio em qualquer etapa da configuração.
