diff --git a/plugins/azure/server/auth/azure.ts b/plugins/azure/server/auth/azure.ts index 5517dc6531..6f1a3a9c99 100644 --- a/plugins/azure/server/auth/azure.ts +++ b/plugins/azure/server/auth/azure.ts @@ -69,9 +69,9 @@ if (env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET) { ); } - if (!organizationResponse) { + if (!organizationResponse?.value?.length) { throw MicrosoftGraphError( - "Unable to load organization info from Microsoft Graph API" + `Unable to load organization info from Microsoft Graph API: ${organizationResponse.error?.message}` ); } diff --git a/plugins/azure/server/env.ts b/plugins/azure/server/env.ts index 8f43743251..e246c3b62f 100644 --- a/plugins/azure/server/env.ts +++ b/plugins/azure/server/env.ts @@ -19,9 +19,9 @@ class AzurePluginEnvironment extends Environment { @IsOptional() @CannotUseWithout("AZURE_CLIENT_ID") - public AZURE_RESOURCE_APP_ID = this.toOptionalString( - environment.AZURE_RESOURCE_APP_ID - ); + public AZURE_RESOURCE_APP_ID = + this.toOptionalString(environment.AZURE_RESOURCE_APP_ID) ?? + "00000003-0000-0000-c000-000000000000"; @IsOptional() @CannotUseWithout("AZURE_CLIENT_ID")