Skip to content

Commit e9adf67

Browse files
committed
Habilita login com gov br
1 parent 9177561 commit e9adf67

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

config/plugins.php

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,40 @@
22

33
return [
44
'plugins' => [
5-
'MultipleLocalAuth',
6-
'AdminLoginAsUser',
7-
'RecreatePCacheOnLogin',
8-
'SpamDetector'
5+
'MultipleLocalAuth' => [
6+
'namespace' => 'MultipleLocalAuth',
7+
'config' => array(
8+
'salt' => env('AUTH_SALT', null),
9+
'timeout' => '24 hours',
10+
'strategies' => [
11+
'govbr' => [
12+
'visible' => env('AUTH_GOV_BR_ID', true),
13+
'response_type' => 'code',
14+
'scope' => 'openid email profile phone govbr_confiabilidades',
15+
'redirect_uri' => 'https://experimente-minc.mapas.tec.br/autenticacao/govbr/oauth2callback',
16+
'auth_endpoint' => 'https://sso.staging.acesso.gov.br/authorize',
17+
'token_endpoint' => 'https://sso.staging.acesso.gov.br/token',
18+
'nonce' => 'abc',
19+
'code_challenge_method' => 'S256',
20+
'userinfo_endpoint' => 'https://sso.acesso.gov.br/jwk',
21+
'state_salt' => "mapasminc",
22+
'applySealId' => 1,
23+
'menssagem_authenticated' => "",
24+
'dic_agent_fields_update' => [
25+
'nomeCompleto' => 'full_name',
26+
'name' => 'name',
27+
'documento' => 'cpf',
28+
'cpf' => 'cpf',
29+
'emailPrivado' => 'email',
30+
'telefone1' => 'phone_number',
31+
]
32+
]
33+
34+
]
35+
)
36+
],
37+
'AdminLoginAsUser',
38+
'RecreatePCacheOnLogin',
39+
'SpamDetector'
940
]
1041
];

dev/config.d/auth.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
'auth.config' => [
88
'salt' => env('AUTH_SALT', null),
99
'wizard' => 'true',
10-
'timeout' => '24 hours',
10+
'timeout' => '24 hours',
1111
'strategies' => [
12+
'GovBr' => [
13+
'client_id' => env('AUTH_GOV_BR_CLIENT_ID', null),
14+
'client_secret' => env('AUTH_GOV_BR_CLIENT_SECRET', null),
15+
'scope' => env('AUTH_GOV_BR_SCOPE', 'openid email profile phone govbr_confiabilidades'),
16+
],
1217
'Facebook' => [
1318
'app_id' => env('AUTH_FACEBOOK_APP_ID', null),
1419
'app_secret' => env('AUTH_FACEBOOK_APP_SECRET', null),

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ x-defaults: &defaults
3535
AUTH_LOGIN_ON_REGISTER: ${AUTH_LOGIN_ON_REGISTER}
3636
STATUS_CREATE_AGENT: ${STATUS_CREATE_AGENT}
3737
AUTH_LOGIN_BY_CPF: ${AUTH_LOGIN_BY_CPF}
38+
AUTH_SALT: ${AUTH_SALT}
39+
AUTH_GOV_BR_ID: ${AUTH_GOV_BR_ID}
40+
AUTH_GOV_BR_CLIENT_ID: ${AUTH_GOV_BR_CLIENT_ID}
41+
AUTH_GOV_BR_CLIENT_SECRET: ${AUTH_GOV_BR_CLIENT_SECRET}
42+
AUTH_GOV_BR_SCOPE: ${AUTH_GOV_BR_SCOPE}
3843

3944
services:
4045
backend:

0 commit comments

Comments
 (0)