Search WebSpherePower's 6,567 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
Submit your Abstracts Today for 2010 Exceptional Web Experience
Building Web Reputation Systems
Accusations Fly in Viacom, YouTube Copyright Fight
Cybercrime's bulletproof hosting exposed
O'Reilly Velocity Conference Opens Registration and Reveals Program
SAN SnapShot Backup for VMWare
What users want from Oracle's Java Community Process
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
DominoPower: Syncing Notes with Android phones
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

SECURE YOUR SITE WITH AN IRONCLAD SSL CERTIFICATE
An IronClad SSL Certificate helps you build an impenetrable fortress around your customer's credit card information. IronClad SSL Certificates are:

  • Fully validated
  • Up to 256-bit encryption
  • One, two, or three year validity (our Turbo SSL Certificates are valid up to 10 years)
  • 99% browser recognition
  • Stringent authentication
  • Around-the-clock customer support

Build trust. Protect your customers. Grow your online business.

Tap here now and be IronClad with SSL tonight.

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