portals-jetspeed-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marina <ppi...@yahoo.com>
Subject RE: Jetspeed2 M1 security setup (was: jetspeed-newbie Roles-Groups-Users)
Date Tue, 07 Dec 2004 00:06:25 GMT

  I've successfully built and installed J2 M1 and was
looking into the demo applications to figure out how
to setup access control for portlets/pages.
After checking out some example portlets , like
RoleSecurityTest and Login, and their source code, I
think I have some idea of how to approach the task but
I would like to clarify some topics.
First, I'll list my assumptions and then ask

 file specifies 'Edit'/'View' permissions for the
default Portal's page, defined in default-page.psml
Thus, this part :
  <security-constraints-def name="admin">
      <permissions>view, edit</permissions>
means that only a user with the role 'admin' can edit
the layout of the page.
And this fragment:
  <security-constraints-def name="manager">
means that a user with the role 'manager' can view the
However, anybody can view this default page in reality
- even before a user logs in. You don't need any
special privileges to access
http://localhost:8080/jetspeed to see the page.
My assumption is that it is because security
constraints are "overwritten" in the
pages/folder.metadata file (see below). 
Is that true?
What is the scope of the page.security definitions and
where are they used?

2. each folder under /pages directory (including
/pages itself) has a folder.metadata file where more
<security-constraints> are defined for that folder.
For example, here is pages/folder.metadata:

And this is why all users can see the default page.
(Is that true?)
On the other hand, here is
pages\Administrative\folder.metadata :
  <title>Jetspeed Administrative Portlets</title> 
  <!-- allow only manager role -->

This folder corresponds to the "Jetspeed
Administrative Portlets" menu item in the 'Folder and
Pages' menu on the left side of the Portal window.
However, it is  displayed only when a user with the
'manager' role logged in.

3. There also are security-constraints in the .psml
files themselves. For example, pages/default-page.psml

4. Also, there are <security-ref> defined in the
portlet.xml files of individual portlets. For example:
  <portlet id="RoleSecurityTest">

and corresponding <security-roles> are defined in the
web.xml file of the portlet application:
    <description>The admin role</description>
    <description>The manager role</description>
    <description>The user role</description>

-- How do all the security declarations in #1, 2, 3
and 4 relate to each other?
-- What declarations take precedence?
-- what declarations are mandatory for others to work?

5. By looking at the
file I noticed that there were two example SSO
servlets registered - SSODemoServlet and
SSOBasicDemoServlet, and they were mapped to /sso-demo
and /sso-basic URLs respectively. Here is how
/sso-basic is protected:


When I access this servlet as
I am getting a login screen that prompts me to enter
username and password, as expected.

The /sso-demo is not protected in the web.xml and when
accessing it as http://localhost:8080/demo/sso-demo
you just get an authentication error. Source code of
the SSODemoServlet gives some explanation:
 * SSODemoServlet - looks for username, password in
the URL for single
 * signon to this servlet from a SSO portlet.
 * Username request parameter: ssouser
 * Password request parameter: ssopw
A few questions here:
-- how can you use these servlets from your portlets
if you want to utilize the Basic authentication
mechanism?  Should I just call
RequestDispatcher.include("/demo/sso-basic")? If not -
how else could I use these servlets in portlets? Or,
maybe, not use servlets at all but get the Basic
authentication working for portlets somehow?

-- when supplying incorrect username/password for the
SSOBasicDemo servlet, you get an error page in the
browser and if you try to reload it it would not work
and would not let you to retry login, until you start
a new browser session. I checked my browser settings
(both Mozilla and IE) and made sure they do not cache
pages between requests - still the same problem. I'm
sure it's something very simple - but what?

  Thanks fo rreading this till the end :)

Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.

To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

View raw message