Skip to content

Commit

Permalink
Habilita login com gov br
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirola committed Nov 23, 2024
1 parent ae7e728 commit ac374b7
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ AUTH_EMAIL_IMAGE=
AUTH_LOGIN_ON_REGISTER=true
STATUS_CREATE_AGENT=1
AUTH_LOGIN_BY_CPF=false


AUTH_SALT=0123456789
AUTH_GOV_BR_CLIENT_ID=xxxxxxxxxx
AUTH_GOV_BR_CLIENT_SECRET=fdsafdsafdsa
AUTH_GOV_BR_ID="true"
AUTH_GOV_BR_SCOPE="openid email profile phone govbr_confiabilidades"
30 changes: 28 additions & 2 deletions config/authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,38 @@
'wizard' => 'true',
'timeout' => '24 hours',
'strategies' => [
'Facebook' => [
'govbr' => [
'client_id' => env('AUTH_GOV_BR_CLIENT_ID', null),
'client_secret' => env('AUTH_GOV_BR_CLIENT_SECRET', null),
'scope' => env('AUTH_GOV_BR_SCOPE', 'openid email profile phone govbr_confiabilidades'),
'visible' => env('AUTH_GOV_BR_ID', true),
'response_type' => 'code',
'scope' => 'openid email profile phone govbr_confiabilidades',
'redirect_uri' => 'https://experimente-minc.mapas.tec.br/autenticacao/govbr/oauth2callback',
'auth_endpoint' => 'https://sso.staging.acesso.gov.br/authorize',
'token_endpoint' => 'https://sso.staging.acesso.gov.br/token',
'nonce' => 'abc',
'code_challenge_method' => 'S256',
'userinfo_endpoint' => 'https://sso.staging.acesso.gov.br/jwk',
'state_salt' => "mapasminc",
'applySealId' => 1,
'menssagem_authenticated' => "",
'dic_agent_fields_update' => [
'nomeCompleto' => 'full_name',
'name' => 'name',
'documento' => 'cpf',
'cpf' => 'cpf',
'emailPrivado' => 'email',
'telefone1' => 'phone_number',
]
],

'Facebook' => [
'app_id' => env('AUTH_FACEBOOK_APP_ID', null),
'app_secret' => env('AUTH_FACEBOOK_APP_SECRET', null),
'scope' => env('AUTH_FACEBOOK_SCOPE', 'email'),
],

'Google' => [
'client_id' => env('AUTH_GOOGLE_CLIENT_ID', null),
'client_secret' => env('AUTH_GOOGLE_CLIENT_SECRET', null),
Expand Down
8 changes: 4 additions & 4 deletions config/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

return [
'plugins' => [
'MultipleLocalAuth',
'AdminLoginAsUser',
'RecreatePCacheOnLogin',
'SpamDetector'
'MultipleLocalAuth',
'AdminLoginAsUser',
'RecreatePCacheOnLogin',
'SpamDetector'
]
];
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ x-defaults: &defaults
AUTH_LOGIN_ON_REGISTER: ${AUTH_LOGIN_ON_REGISTER}
STATUS_CREATE_AGENT: ${STATUS_CREATE_AGENT}
AUTH_LOGIN_BY_CPF: ${AUTH_LOGIN_BY_CPF}
AUTH_SALT: ${AUTH_SALT}
AUTH_GOV_BR_ID: ${AUTH_GOV_BR_ID}
AUTH_GOV_BR_CLIENT_ID: ${AUTH_GOV_BR_CLIENT_ID}
AUTH_GOV_BR_CLIENT_SECRET: ${AUTH_GOV_BR_CLIENT_SECRET}
AUTH_GOV_BR_SCOPE: ${AUTH_GOV_BR_SCOPE}

services:
backend:
Expand Down

0 comments on commit ac374b7

Please sign in to comment.