From f52ce37ec8c3cf0c9cf8025982161ca8a3de5b8e Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Thu, 13 Oct 2022 19:51:39 -0400 Subject: [PATCH 1/2] MS OAuth2: Don't force consent prompt Microsoft OAuth2 endpoints are smart enough that we don't need to tell it to issue a consent prompt. In a number of cases (I tested this with two separate differently configured differently-secured tenants on MS365 today), defining `'prompt' => 'consent'` as one of the url options will force **admin consent** (this is translated to `admin_consent` on the MS365 backend - figured out after a 3 hour power session with MS365 admins and support who discovered this). When you send the OAuth request to MS365, the system is smart enough to determine if you need consent or not, and you do **NOT** need to tell MS365 that a consent window is required. That may be a requisite for other providers, but not MS365 based on the testing I've done. --- auth-oauth2/oauth2.php | 1 - 1 file changed, 1 deletion(-) diff --git a/auth-oauth2/oauth2.php b/auth-oauth2/oauth2.php index 9312527c..337c9a17 100644 --- a/auth-oauth2/oauth2.php +++ b/auth-oauth2/oauth2.php @@ -637,7 +637,6 @@ class MicrosoftEmailOauth2Provider extends GenericEmailOauth2Provider { static $urlOptions = [ 'tenant' => 'common', 'accessType' => 'offline_access', - 'prompt' => 'consent', ]; } ?> From baa0a63d2afedf05d07eb8fbc5d6f361ddd05033 Mon Sep 17 00:00:00 2001 From: aydreeihn Date: Thu, 3 Nov 2022 11:07:14 -0500 Subject: [PATCH 2/2] Issue: Decrease S3 Plugin Size This commit reduces the size of the S3 plugin by only pulling services related to S3 from the AWS SDK. This is done by following the steps outlined here: https://github.com/stobrien89/aws-sdk-php/tree/remove-unused-services/src/Script/Composer --- storage-s3/plugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/storage-s3/plugin.php b/storage-s3/plugin.php index 4a99fc42..13ad3101 100644 --- a/storage-s3/plugin.php +++ b/storage-s3/plugin.php @@ -12,8 +12,7 @@ "aws/aws-sdk-php" => array( 'version' => "3.*", 'map' => array( - 'aws/aws-sdk-php/src/{Api*,Arn*,ClientSideMonitoring*,Credentials*,DefaultsMode*,Endpoint*,Exception*,Handler*,Retry*,S3*,Signature*,*.php}' => 'lib/Aws', - 'aws/aws-sdk-php/src/data' => 'lib/Aws', + 'aws/aws-sdk-php/src' => 'lib/Aws', 'guzzlehttp/guzzle/src' => 'lib/GuzzleHttp', 'guzzlehttp/promises/src' => 'lib/GuzzleHttp/Promise', 'guzzlehttp/psr7/src/' => 'lib/GuzzleHttp/Psr7', @@ -24,6 +23,12 @@ ), ), ), + 'scripts' => array( + 'pre-autoload-dump' => 'Aws\\Script\\Composer\\Composer::removeUnusedServices', + ), + 'extra' => array( + 'aws/aws-sdk-php' => 'S3', + ), 'plugin' => 'storage.php:S3StoragePlugin' );