• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

I've logged into Websphere Portal but request.getUserPrincipal() returns null

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I'm trying to develop a "portal-friendly" servlet. A user clicks on a link in WS Portal (4.2) and a new browser window opens that loads a form using a servlet. I'd like to display in the result the name of the authenticated user, so I call request.getUserPrincipal() --> this returns null.
I also tried showing a document in iFrame --> no user...
So how do I get the actual user? Do I need to restrict access to the servlet?
Any help appreciated.
:-) stw
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With the Portal, I'd recommend using portlets instead which are like servlets. There is a portlet development doc on the IBM site.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jim,
thx for your answer. I had a look into portlets, it looks ok, however...
The servlet is just a test to find out how to integrate existing J2EE servlets into a portal. If we have to rewrite all servlets into portlets this would be substantial effort I finally try to avoid. Could u point me to the security model of portal?

Originally posted by Jim Baiter:
With the Portal, I'd recommend using portlets instead which are like servlets. There is a portlet development doc on the IBM site.

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
The ServletInvokerPortlet serves up existing servlets as portlets. You could find it helpful.
JavaRanch is really informative for WSAD and WAS information, but the Portal Forum is a better bet for these specific questions (Is this against forum posting etiquette, I wonder?) http://www-106.ibm.com/developerworks/forums/dw_forum.jsp?forum=168&cat=9
The WebSphere Portal Server Infocenter also has a lot of helpful information:
http://www7b.software.ibm.com/wsdd/zones/portal/V41InfoCenter/InfoCenter/wpf-ena/en/InfoCenter/index.html
Good luck,
Jaye
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the records: How it workes:
(I'm not sure if all parts are needed)
1) let the servlet run in the same realm e.g. /wps/myservlet
2) Create Roles and protect the servlet
--------------------
If you have installed the servlet before you need to: a) uninstall it b) reinstall the Enterprise app and assign the roles c) RESTART Websphere (Strange but needed)
... Hope that helps ...
 
I am mighty! And this is a mighty small ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic