async def create_oauth2_connection_for_whitelabel(
        db: AsyncSession,
        white_label: schemas.WhiteLabel,
        code: str,
        user: schemas.User,
    ) -> schemas.Connection:
        """Create a new OAuth2 connection using white label credentials.

        Args:
        ----
            db: Database session
            white_label: The white label configuration to use
            code: The authorization code to exchange
            user: The user creating the connection

        Returns:
        -------
            schemas.Connection: The created connection
        """
        source = await crud.source.get_by_short_name(db, white_label.source_short_name)
        if not source:
            raise NotFoundException(f"Source not found: {white_label.source_short_name}")

        settings = await integration_settings.get_by_short_name(source.short_name)
        if not settings:
            raise NotFoundException("Integration not found")

        if not OAuth2Service._supports_oauth2(source.auth_type):
            raise HTTPException(status_code=400, detail="Source does not support OAuth2")

        # Exchange code for token using white label credentials
        oauth2_response = await OAuth2Service.exchange_code_for_whitelabel(
            code=code, white_label=white_label
        )

        return await OAuth2Service._create_connection(
            db=db,
            source=source,
            settings=settings,
            oauth2_response=oauth2_response,
            user=user,
        )
Create a new OAuth2 connection using white label credentials.

        Args:
        ----
            db: Database session
            white_label: The white label configuration to use
            code: The authorization code to exchange
            user: The user creating the connection

        Returns:
        -------
            schemas.Connection: The created connection
        
backend/airweave/platform/auth/services.py