Setting up Customer class in the customer-data-framework plugin

Using this guide:
When I use SSO to register a new customer I get the error:

Type error: Argument 1 passed to CustomerManagementFrameworkBundle\Security\OAuth\OAuthRegistrationHandler::connectSsoIdentity() must implement interface Symfony\Component\Security\Core\User\UserInterface, instance of Pimcore\Model\DataObject\Customer given, called in /var/www/ on line 185

I think it’s because I’m not ‘linking’ my Customer.php with the Pimcore generated Customer.

These are the steps I followed:

  1. Using the example json import, pimcore generates Customer.php (see
namespace Pimcore\Model\DataObject;
class Customer extends \CustomerManagementFrameworkBundle\Model\AbstractCustomer implements \Pimcore\Model\DataObject\DirtyIndicatorInterface {
  1. Copied Customer.php from
namespace AppBundle\Model\DataObject\Data;
use CustomerManagementFrameworkBundle\Model\AbstractCustomer\DefaultAbstractUserawareCustomer;
use CustomerManagementFrameworkBundle\Model\SsoAwareCustomerInterface;
abstract class Customer extends DefaultAbstractUserawareCustomer implements SsoAwareCustomerInterface
  1. In config.yml
        enabled: true

    # Configuration of general settings
        customerPimcoreClass: Customer
        mailBlackListFile:    /home/customerdataframework/www/var/config/cmf/mail-blacklist.txt
... etc
  1. Registering a new customer after login via SSO
    In AuthController.php
    Copied from
        // create a new, empty customer instance
        /** @var CustomerInterface|\Pimcore\Model\DataObject\Customer $customer */
        $customer = $customerProvider->create();

I get the above error at this point.
Is there additional configuration needed for the AppBundle\Model\DataObject\Data\Customer.php to extend Pimcore\Model\DataObject\Customer class?

you need to make sure, that your customer data object class is extending your abstract customer class… see also parent class for data objects.


Thanks Christian. This has helped me. I had understood that my Customer class should extend the pimcore generated class. But after considering your reply, my Customer class is the base of the generated Customer class.
Thanks for your help!