Search WebSpherePower's 6,962 WebSphere, Java, and Eclipse article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Even more adventures with Roller Weblogger (continued)

Finally, I felt as if I was on to something when I discovered the UserPrincipal wasn't being populated in every situation that resulted in an error. But why?

That one took a little while to figure out, but after testing out a number of different potential fixes, I managed to wander right across the path of the root of the problem.

WebSphere authentication and the UserPrincipal Object
There were three URL patterns that were causing the issue: /categories.do, /themeEditor.do, and /user.do. As it turns out, those same three URL patterns were missing from the list of protected resources in the editor role security constraint.

Apparently, if you're not dealing with a protected resource, then WebSphere doesn't feel the need to populate the UserPrincipal object. To fix the problem, all I needed to do was to add these patterns to the list of protected URLs.

To add the URL patterns, I opened up the Deployment Descriptor of the Web project and clicked on the Security tab on the bottom of the screen. Then I used the tabs at the top of the Security panel to navigate to the Security Constraints section shown in Figure G.

FIGURE G


Open the Security Constraints panel of the Web project Deployment Descriptor. Roll over picture for a larger image.

I clicked on the EditPages Web resources collection to bring it into focus, then clicked on the Edit button to bring up the Web Resources Collection dialog box in Figure H.

FIGURE H


Enter all of the missing URL patterns here. Roll over picture for a larger image.

Using the Add button, I entered the missing URL patterns, closed and saved the Deployment Descriptor, and restarted the server.

Once the server was back up and running, I logged back in and started clicking around again. Things were definitely starting to come together, but there was still an annoying little glitch.

If I ever went back to the main menu (which wasn't protected for obvious reasons), I lost the UserPrincipal again and had to go through a few hoops to get back to wherever I was. There was a way to do it involving the Register option followed by the Login option, but that definitely wasn't acceptable.

I finally came up with a solution to this issue, but it wasn't quite as easy as just adding a few missing resources.

The solution (yet another hack)
Solving this problem involved creating an entirely new role and associated security constraint. WebSphere provides an extension to the standard users/groups method of role definition that involves either all authenticated users, or all users, authenticated or not.

By creating a new role that I called everyone, and a new security constraint that allowed both editors, and everyone else, access to the main menu, I essentially secured the resource (maintaining the existence of the UserPrincipal), while still allowing non-authenticated users to get to that main page.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
Home > Projects > Roller Weblogger (3 articles)
   Further Adventures with Roller Weblogger
   Adventures with Roller Weblogger
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent WebSpherePower Articles
A perfect 10: celebrating 10 years online
You can help bring security and safety back to White House email
Introducing the WebSpherePower RSS feeds
From New Jersey to Palm Bay, Florida
A WebSphere pot o' gold
How Elvis entered the building and CES went out the window
WebSphere Application Server 6: what's it all mean?
WebSpherePower News
Excitement brewing for JavaOne 2010, with or without Google
Large companies ignore data centre advice
Onapsis to Release ERP Vulnerability Testing Suite
Botnet Takedown May Yield Valuable Data
VMware app dev platform gazes beyond SpringSource Java
IBM Claims World's Fastest Chip
'Free Java': InfoWorld's guide to the protest goodies
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Smartphone smarts for a mobile world
David Gewirtz Online: CNN commentary and analysis
DominoPower: It's time for Lotus to double-down on Linux and open source
OutlookPower: The strange case of Outlook losing notes and requiring passwords
-- Advertisement --

EASY DEDICATED AND VIRTUAL DEDICATED SERVERS FOR AS LOW AS $67.99 PER MONTH
Customize and configure your own dedicated server. Simply choose one of our popular plans or select your own Linux or Windows server and plan options.

NO LONG WAITS. Server provisioned within hours.

Tap here now and be up and running with your own server tonight.

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login