Topic
  • 4 replies
  • Latest Post - ‏2014-08-14T17:43:12Z by DanieleVistalli
AnshilaTiku
AnshilaTiku
1 Post

Pinned topic Logged in user info in portlets

‏2013-04-16T13:58:35Z |

Hi,

How can I get the logged in user information (Userid/Pwd)  in a WEF portlet. My portlet is deployed on portal server 8.

I need the logged in user credentials to call a REST service in portlet.

 

Please help.

Thanks

Anshila

 

  • kevintap
    kevintap
    752 Posts

    Re: Logged in user info in portlets

    ‏2013-04-17T18:38:37Z  

    You can obtain the current user by calling webAppAccess.getUserInfo().getUserID();  You cannot obtain the user's password.  You may be able to leverage something like Portal's Credential Vault for secure storage of user credentials.  Alternatively, you may consider using a single administrative/service ID for all calls to the REST API, possibly passing the current userid as an argument to the REST service if the data returned needs to be customized on a per-user basis.

  • Jay.sk
    Jay.sk
    7 Posts

    Re: Logged in user info in portlets

    ‏2014-07-15T20:03:56Z  
    • kevintap
    • ‏2013-04-17T18:38:37Z

    You can obtain the current user by calling webAppAccess.getUserInfo().getUserID();  You cannot obtain the user's password.  You may be able to leverage something like Portal's Credential Vault for secure storage of user credentials.  Alternatively, you may consider using a single administrative/service ID for all calls to the REST API, possibly passing the current userid as an argument to the REST service if the data returned needs to be customized on a per-user basis.

    Kevin

                   I'm trying to build a custom portlet for the search functionality in websphere portal. The rest service that was provided out of box required logged in information to retrive the customized list per user. Is there anyway that we can use the implicit authentication as we do in WCM manager access builder?

     

    Thanks

  • mburati
    mburati
    2579 Posts

    Re: Logged in user info in portlets

    ‏2014-08-08T17:23:46Z  
    • Jay.sk
    • ‏2014-07-15T20:03:56Z

    Kevin

                   I'm trying to build a custom portlet for the search functionality in websphere portal. The rest service that was provided out of box required logged in information to retrive the customized list per user. Is there anyway that we can use the implicit authentication as we do in WCM manager access builder?

     

    Thanks

    Can you provide more detail as to what the actual required information is?   If it's just the username, you can get that with webAppAccess.getUserInfo().getUserID()

     

    I hope that info helps,

    ..Mike Burati

    http://www-10.lotus.com/ldd/pfwiki.nsf/

    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

  • DanieleVistalli
    DanieleVistalli
    11 Posts

    Re: Logged in user info in portlets

    ‏2014-08-14T17:43:12Z  
    • Jay.sk
    • ‏2014-07-15T20:03:56Z

    Kevin

                   I'm trying to build a custom portlet for the search functionality in websphere portal. The rest service that was provided out of box required logged in information to retrive the customized list per user. Is there anyway that we can use the implicit authentication as we do in WCM manager access builder?

     

    Thanks

    If you want to call the rest service you can setup your HTTP call passing the LTPAToken cookie in the backend request.

    If you add to your rest request the LTPAToken with the user's LTPAToken then you get SSO out of the box and don't need any credentail

    LTPAToken acts as your identity token for the rest service and you get results personalized for you.

     

    What version of WEF are you using ?

    Which builder do you use to perform the call to the Search rest service ?