This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » Security Listener and UserWrapper

Security Listener and UserWrapper

Security Listener and UserWrapper

Thursday 18 September 2014 8:22:11 pm

Hi. I'm working in a project where users come from a webservice. This webservice holds the info about the users (phone, address...) but this info can't be stored in the database due project requirements. 

I have implemented the authentication part but now i need to show data coming from the webservice in the twig templates. Let's think in the tipical "Hello [User First Name]". 

I've created my user provider. this provider returns user of a class that is implementing UserInterface symfony class. This custom user class has properties like phone or address. These properties get its values from the webservice response;

As far i see, in a following step, Security Listener returns a new UserWrapped object. This userObject has the originalUser info (that i filled with data from the webservice ) and the api user.  The info coming from the webservice are assigned to the wrappedUser property of this UserWrapped object. 

Now, the question. How can i access this wrappedUser property from, for example, one of my controllers? This is a private property and there is no method in the class to get it. You can get some properties of this wrappedUser though, but there is no method i can use to get phones of these user.

Thanks in advance.

No reply yet!


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from