public function getIdentity()
    {
        if($this->hasIdentity()){
            if($this->identity === null){
                
                $identity = $this->authenticationService->getIdentity();
                $identity = array_merge(
                    $identity,
                    $this->getOption('identity')        
                );
                
                // Extend with real identity information
                if ($this->getServiceBroker()->exists('User')) {
                    $userService = $this->getServiceBroker()->service('User');
                    
                    // Access filter needs to be disabled to prevent infinite looping
                    $userService->disableFilter('access');
                    
                    $extension = $userService->find(
                        '$'.$identity['username'],
                        array('id', 'email')
                    );
                    
                    if ($extension) {
                        $identity = array_merge($identity, $extension);
                    }
                }
                
                $this->identity = $identity;
            }
            
            return $this->identity;
        }
        else{
            return null;
        }
    }