1 Reply Latest reply on Oct 30, 2010 4:33 PM by Marcel Kolsteren

    Extending the openId login procedure

    Enrico Gulfi Newbie


      I have integrated openId as an authentication method in a Seam 2.2 application as suggested in the documentation. So far so good. Now I'd like to add the authorization part which requires retrieving the user roles from the database using the user id. For that purpose I have added the following bean to the project:

      @Install(precedence = Install.BUILT_IN, classDependencies = "org.openid4java.consumer.ConsumerManager")
      public class CustomOpenId {
          @In Identity identity;
          @In @Out OpenId openId;
          @In(create=true) UserList userList;
          public boolean loginImmediately() {
              if (openId.loginImmediately()) {
             User aUser = userList.getSingleResult();
             if (aUser != null) {
                 return true;
             } else {
                 try {
                     } catch (ConsumerException e) {
             return false;

      and created the following openid.page.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
          <navigation evaluate="#{myopenid.loginImmediately()}">
              <rule if-outcome="true">
                  <redirect view-id="/home.xhtml">
                      <message>OpenID login successful...</message>
              <rule if-outcome="false">
                  <redirect view-id="/home.xhtml">
                      <message>OpenID login rejected...</message>

      Unfortunately, when logging in, after a successful identity verification, I get the following exception

      16:47:12,465 WARNING [lifecycle] JSF1053: (Listener: org.jboss.seam.security.openid.OpenIdPhaseListener.beforePhase(),
      Phase ID: RENDER_RESPONSE 6,  View ID: /openid.xhtml) 
      Exception thrown during phase-listener execution: 
      javax.el.ELException: org.jboss.seam.RequiredException: @In attribute requires non-null value: myopenid.openId

      and an HTTP 404 error on the browser for not being able to retrieve the openid.seam page.


      - is this the right approach for extending the openid login process?

      - why is the myopenid.openid null?

      Thanks in advance,