Jahia in English > JSR 286 Portlet...

0 (0 Good)
0 (0 Bad)

JSR 286 Portlet Development: Getting the current user

by  jpaagt »  2011/06/07 18:42

[b:2xwkpi2u]This topic referes to Jahia CE v6 build 25203.[/b:2xwkpi2u]

How can the current logged in user be obtained from within a Portlet. The user info map specified by the JSR 286 specification, when obtained, returns a null reference. The request.getRemoteUser() method also returns a null reference and I can't find any information about a Jahia specific mechanism to obtain the logged in user info.

By the way, I don't think the keywords [b:2xwkpi2u]portlet[/b:2xwkpi2u] and [b:2xwkpi2u]user[/b:2xwkpi2u] should be filtered out in the forum search. At least not [b:2xwkpi2u]portlet[/b:2xwkpi2u]. I'm currently interested in developing portlets for Jahia and this restriction makes it annoying to find existing posts in the forum.

Thx.

  (jpaagt)

Number of messages  8
Registration date
0 (0 Good)
0 (0 Bad)

Re: JSR 286 Portlet Development: Getting the current user

by  jpaagt »  2011/06/07 18:42

Made some new tests and I was wrong, the [code:268v2890]PortletRequest#getRemoteUser()[/code:268v2890] does return a value, in my case, for the root user it returns [i:268v2890]root:0[/i:268v2890]. Looking at the Google Gadgets portlet I found the following:

[code:268v2890]JahiaUser user = ServicesRegistry/1[/code:268v2890]

It would be nice if the user info map defined by the portlet spec were also supported.

  (jpaagt)

Number of messages  8
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page