Skip to content

XAware Community - Sponsored by Sparxent

You are here: Home arrow Forums
XAware Community Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Recover authenticated username in bizDocument (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Recover authenticated username in bizDocument
#5859
cvillemure (User)
XAware user
Posts: 29
User Offline Click here to see the profile of this user
Recover authenticated username in bizDocument 7 Months, 4 Weeks ago Karma: 0  
Hi,

i'd like to know if there's a way to recover the authenticated username in my BizDocument? Is this information delayed from Spring to XAware after authentication?

Charles
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5862
cvillemure (User)
XAware user
Posts: 29
User Offline Click here to see the profile of this user
Re:Recover authenticated username in bizDocument 7 Months, 4 Weeks ago Karma: 0  
Hi,

after digging in the source code i finally discover that the class org.xaware.server.security.SecurityManager.java is doing the ressource role validation and have access to the org.xaware.server.security.XALoginContext that have the current logged in user and his roles. This information is based on the user that logged in by the HTTP Connector trough Spring Security.

So I added this few lines :

Code:

// Add user information in the connectorProperties String username = XALoginContext.getUsername(); invocationParams.connectorProperties.setProperty("ExecuteUserId",username); String userRoles = XALoginContext.getRoleList(); invocationParams.connectorProperties.setProperty("ExecuteUserRoles",userRoles);
    to the org.xaware.server.connector.servlet.XAServlet.java in the method getInvocationParamsFromRequest to have access to this information in my bizDocuments to be able to do some content filtering whitout having to pass the username as a parameter from the client.
      I would have prefer not to play in the code, but I really needed that information and this is the only way I found to access it. If you have better suggestion or improvements I could make, I'm open to suggestions!
        Charles
         
        Report to moderator   Logged Logged  
          The administrator has disabled public write access.
        #5866
        kvandersluis (Admin)
        Admin
        Posts: 401
        User Offline Click here to see the profile of this user
        Re:Recover authenticated username in bizDocument 7 Months, 3 Weeks ago Karma: 13  
        Charles, we have written custom functoids for specific customer projects in the past for this purpose. I like your approach better, having the information saved in a connector property. We'll try and get a similar enhancement scheduled into the development process.

        Thanks,

        -Kirstan
         
        Report to moderator   Logged Logged  
          The administrator has disabled public write access.
        Go to top Post Reply
        Powered by FireBoardget the latest posts directly to your desktop

        Community Login

        Get the Flash Player to see this player.
        Flash Image Rotator Module by Joomlashack.
        Commercial
        Free Training
        QuickStart Packages
        Image 4 Title
        Image 5 Title

        Visit XAware.com