Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Add use_oidc_mode in Google OAuth
Browse files Browse the repository at this point in the history
Fixes #587

By default still uses the Google+ API, but the Directus configuration by default it enables the OIDC mode
  • Loading branch information
wellingguzman committed Dec 3, 2018
1 parent 2ba02ec commit 9601d56
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/api_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// // Uses OpenIDConnect to fetch the email instead of using the Google+ API
// // Disabling the OIDC Mode, requires you to enable the Google+ API otherwise it will fail
// 'use_oidc_mode' => true,
// ],
// 'twitter' => [
// 'identifier' => '',
Expand Down
3 changes: 2 additions & 1 deletion public/extensions/core/auth/google/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ protected function createProvider()
'clientId' => $this->config->get('client_id'),
'clientSecret' => $this->config->get('client_secret'),
'redirectUri' => $this->getRedirectUrl(),
'hostedDomain' => $this->config->get('hosted_domain')
'hostedDomain' => $this->config->get('hosted_domain'),
'useOidcMode' => (bool) $this->config->get('use_oidc_mode'),
]);

return $this->provider;
Expand Down
3 changes: 3 additions & 0 deletions src/core/Directus/Util/Installation/stubs/config.stub
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ return [
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// // Uses OpenIDConnect to fetch the email instead of using the Google+ API
// // Disabling the OIDC Mode, requires you to enable the Google+ API otherwise it will fail
// 'use_oidc_mode' => true,
// ],
// 'twitter' => [
// 'identifier' => '',
Expand Down
3 changes: 3 additions & 0 deletions tests/api/Util/Installation/mock/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// // Uses OpenIDConnect to fetch the email instead of using the Google+ API
// // Disabling the OIDC Mode, requires you to enable the Google+ API otherwise it will fail
// 'use_oidc_mode' => true,
// ],
// 'twitter' => [
// 'identifier' => '',
Expand Down
3 changes: 3 additions & 0 deletions tests/api/Util/Installation/mock/config.sample2.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// // Uses OpenIDConnect to fetch the email instead of using the Google+ API
// // Disabling the OIDC Mode, requires you to enable the Google+ API otherwise it will fail
// 'use_oidc_mode' => true,
// ],
// 'twitter' => [
// 'identifier' => '',
Expand Down

0 comments on commit 9601d56

Please sign in to comment.