Hacking GridSphere authentication

GridSphereServlet.login(GridSphereEvent event)

appears to be the section of code we need to modify if we want to use Crowd authentication. Then, rebuild gridsphere.jar and deploy it along with the tdar.

        PortletRequest req = event.getPortletRequest();
        PortletResponse response = event.getPortletResponse();
        String username = req.getParameter("username");
        String password = req.getParameter("password");
        HttpAuthenticator authenticator = HttpAuthenticatorFactory.getHttpAuthenticator();
        try {
            authenticator.authenticate(req, response, username, password);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
        } catch (InvalidAuthorizationTokenException e) {
            // TODO Auto-generated catch block
        } catch (InvalidAuthenticationException e) {
            // TODO Auto-generated catch block
        } catch (InactiveAccountException e) {
            // TODO Auto-generated catch block


How to make a new portlet

  1. ant new-portlet
  2. Create a JSR-168 portlet (avoid gridsphere's custom gs portlet)
  3. set up appropriate configuration parameters in WEB-INF/portlet.xml and WEB-INF/layout.xml
  4. register portlet with gridsphere/WEB-INF/layout.xml and gridsphere/WEB-INF/CustomPortal/layout/groups/gridsphere.xml
     <portlet-tab label="tdaregister">
            <title lang="en">Register</title>
            <portlet-tabbed-pane style="sub-menu">
                <portlet-tab label="TDAR Project/Data Registration">
                    <title lang="en">TDAR Project/Data Registration</title>
                        <column-layout width="100%">
                            <portlet-frame label="tdaregister">

How to set up the JSR-168 portlet

  1. create a concrete Portlet class, subtype of org.gridlab.gridsphere.provider.portlet.jsr.ActionPortlet - the created portlet must be in a portlets subpackage, otherwise GridSphere won't find it. You can also subclass AbstractTdarPortlet, which will probably live in TdarCorePortlet soon.
  2. in the init(PortletConfig config) method, assign DEFAULT_VIEW_PAGE to the method you want to invoke when the first portlet is encountered. For instance,
    public void init(PortletConfig config) throws PortletException {
        DEFAULT_VIEW_PAGE = "listProjects";
    public void listProjects(RenderFormEvent event) {
        setNextState(event.getRenderRequest(), LIST_PROJECTS_JSP);

How to deploy GEON in a test environment

  1. In order to create accounts you will need to change the SMTP host in several places. After logging in as root, you will need to change the SMTP host under the first Administration tab in the "Configure portal mail settings" portlet.
  2. GAMA portlet: ~/gridsphere/projects/gama/webapp/WEB-INF/web.xml
  3. Core Portlet: ~/gridsphere/projects/CorePortlet/webapp/WEB-INF/classes/
  4. Attribute Authorization Portlet: ~/gridsphere/projects/attrauth/webapp/WEB-INF/classes/

Spring Portlets docs:
Hibernate docs:
EJB Persistence Annotations docs:

Gridsphere docs page:

DeveloperWorks article on how to develop portlets for Gridsphere:

Good overview of portlet/servlet technology:

Gridsphere, Webwork, and Portlets?

Spring Web MVC Portlets: