Merge pull request #14734 from inoveaconseil/NEW_Scope_Oauth_Google
New scope oauth google
This commit is contained in:
commit
52c9e7230f
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
|
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -155,6 +156,9 @@ if ($mode == 'setup' && $user->admin)
|
|||||||
// List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service).
|
// List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service).
|
||||||
// We pass this param list in to 'state' because we need it before and after the redirect.
|
// We pass this param list in to 'state' because we need it before and after the redirect.
|
||||||
$shortscope = 'userinfo_email,userinfo_profile,cloud_print';
|
$shortscope = 'userinfo_email,userinfo_profile,cloud_print';
|
||||||
|
if (!empty($conf->global->OAUTH_GSUITE)){
|
||||||
|
$shortscope .= ',admin_directory_user';
|
||||||
|
}
|
||||||
//$scope.=',gmail_full';
|
//$scope.=',gmail_full';
|
||||||
$urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
$urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
$urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
$urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||||
|
|||||||
@ -116,6 +116,11 @@ class Google extends AbstractService
|
|||||||
// Android Publisher
|
// Android Publisher
|
||||||
const SCOPE_ANDROID_PUBLISHER = 'https://www.googleapis.com/auth/androidpublisher';
|
const SCOPE_ANDROID_PUBLISHER = 'https://www.googleapis.com/auth/androidpublisher';
|
||||||
|
|
||||||
|
|
||||||
|
// Google Gsuite
|
||||||
|
const SCOPE_ADMIN_DIRECTORY_USER = "https://www.googleapis.com/auth/admin.directory.user";
|
||||||
|
const SCOPE_ADMIN_DIRECTORY_CUSTOMER = "https://www.googleapis.com/auth/admin.directory.customer";
|
||||||
|
|
||||||
protected $accessType = 'online';
|
protected $accessType = 'online';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user