async def _exchange_authorization_code_for_token(
        self,
        source_short_name: str,
        code: str,
        client_id: Optional[str] = None,
        client_secret: Optional[str] = None,
    ) -> OAuth2TokenResponse:
        """Exchange an OAuth2 authorization code for a token.

        Args:
            source_short_name: The short name of the source
            code: The authorization code to exchange
            client_id: Optional client ID to override the default
            client_secret: Optional client secret to override the default

        Returns:
            The OAuth2 token response with access token and other details

        Raises:
            HTTPException: If the token exchange fails
        """
        try:
            return await oauth2_service.exchange_authorization_code_for_token(
                source_short_name=source_short_name,
                code=code,
                client_id=client_id,
                client_secret=client_secret,
            )
        except Exception as e:
            raise HTTPException(
                status_code=400, detail="Failed to exchange authorization code for token"
            ) from e
Exchange an OAuth2 authorization code for a token.

        Args:
            source_short_name: The short name of the source
            code: The authorization code to exchange
            client_id: Optional client ID to override the default
            client_secret: Optional client secret to override the default

        Returns:
            The OAuth2 token response with access token and other details

        Raises:
            HTTPException: If the token exchange fails
        
backend/airweave/core/source_connection_service.py