How hkamel/sonar-auth-aad works
Main Components
• SonarQube Server – the host system that will load this plugin.
• AAD Authentication Plugin – the core module that interfaces with SonarQube for authentication.
• AAD Integration Module – the internal components within the plugin that interact with Microsoft Azure services. This includes:
• AadIdentityProvider (which likely acts as an entry point for authentication requests)
• AadTokenHelper (handles token manipulation and validation)
• AadUserInfo (processes and structures information about authenticated users)
• AadSettings (manages configuration or initialization settings for AAD integration)
• AuthAadPlugin (ties everything together as the plugin interface for SonarQube)
• External Service – Microsoft Azure Active Directory, representing the external authentication provider.
• Supporting Resources – configuration files and localization resources (e.g., the properties file for localization in src/main/resources/org/sonar/l10n/authaad.properties) that support internationalization or regional configuration.
Relationships and Data Flow
• The SonarQube Server loads the plug-in (AuthAadPlugin) as part of its authentication mechanism.
• When a user attempts to authenticate, SonarQube delegates the process to the AAD Authentication Plugin.
• Within the plugin, AadIdentityProvider and AadTokenHelper coordinate to validate and process the user’s credentials.
• AadUserInfo retrieves or builds the user details and passes information back to SonarQube after token verification.
• The plugin also references configuration settings (AadSettings) to determine connection parameters (client ID, tenant information, etc.) needed to interact with the external Azure AD service.
• Data flow should clearly illustrate the communication between SonarQube, the plugin internal classes, and the external Azure AD service.
Architectural Patterns and Technologies
• Java/Maven-based application structure where source and test code separation emphasizes professional modular design.
• Standard plugin pattern for extending SonarQube capabilities.
• The integration with Microsoft Azure Active Directory hinges on standard authentication protocols (likely OAuth2 or OpenID Connect).
• Use of configuration and resource files to externalize settings and provide localization support.