Fix: Support Microsoft Graph SDK v6.x+ backingStore architecture for all query operations #169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
All ConnId search and query operations for return only 2 attributes (
__NAME__and__UID__) when using Microsoft Graph SDK v6.0.0+, instead of extracting all requested attributes.Affected Operations
executeQueryforObjectClass.ACCOUNT)executeQueryforObjectClass.GROUP)executeQueryforAZURE_LICENSE)Example Impact
Before Fix:
After Fix:
Root Cause
Microsoft Graph SDK v6.x+ migrated to the Kiota code generator, which fundamentally changed how model classes store properties.
Architecture Change
Older SDK (v5.x and earlier)
Current SDK (v6.1.0+)
Why Only 2 Attributes Were Returned
The connector's
fromUser(),fromGroup(), andfromLicense()methods rely on field-based reflection:Only
__NAME__and__UID__are set outside the try block, so they're the only attributes returned.Evidence
Breaking Change Reference:
Solution
Implemented a backward-compatible fallback that detects when field-based reflection fails and switches to getter-based reflection.
Implementation Strategy
How It Works
getDeclaredFields()returns empty array (fields.length == 0)Class.getMethods()reflectiongetDisplayName()) to extract valuesChanges
Modified File
src/main/java/net/tirasa/connid/bundles/azure/AzureConnector.javaAffected Methods
1.
fromUser()passwordProfile,accountEnabledprovisionedPlans,assignedLicenses,assignedPlans)Upstream Impact: Fixes
executeQuery()forObjectClass.ACCOUNT2.
fromGroup()mailNickname,displayName,groupTypes,securityEnabled, etc.Upstream Impact: Fixes
executeQuery()forObjectClass.GROUP3.
fromLicense()skuPartNumber,capabilityStatus,consumedUnits,prepaidUnits, etc.Upstream Impact: Fixes
executeQuery()forAZURE_LICENSEAdded Imports
Testing
Before Fix (SDK v6.55.0)
After Fix (SDK v6.55.0)
Compatibility
No Breaking Changes
References