2 Replies Latest reply on Oct 4, 2008 10:43 AM by Piotr Jatym

    Form based atuthorization fails

    Piotr Jatym Newbie

      Hi
      I'm tying to use Tomcat 6 jdbc realm form based authorization, but after submiting login form, browser is directed to:

      http://localhost:8080/testApp/a4j/g/3_2_2.GAorg/richfaces/renderkit/html/scripts/skinning.js.jsf


      My web.xml elements:
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       <welcome-file>index.html</welcome-file>
       </welcome-file-list>
      
       <security-constraint>
       <web-resource-collection>
       <web-resource-name>ccEwidencja</web-resource-name>
       <url-pattern>/*</url-pattern>
       </web-resource-collection>
       <auth-constraint>
       <role-name>login</role-name>
       </auth-constraint>
       </security-constraint>
      
       <login-config>
       <auth-method>FORM</auth-method>
       <form-login-config>
       <form-login-page>/login.jsf</form-login-page>
       <form-error-page>/login.jsf?fail=yes</form-error-page>
       </form-login-config>
       </login-config>
       <security-role>
       <role-name>login</role-name>
       </security-role>
      


      login form in login.xhtml:
       <form method="post" action="j_security_check">
       <input type="text" name="j_username" />
       <input type="password" name="j_password" />
       <input type="submit" value="Login"/>
       </form>
      


      Source of redirected page after login:
      {var mediaName="rich-extended-skinning";var skipNavigator=window.opera||navigator.userAgent.indexOf('AppleWebKit/')>-1;if(!skipNavigator){var resetMedia=function(elt){var media=elt.getAttribute('media');if(mediaName==media){elt.removeAttribute('media');}};if(!window._RICH_FACES_SKINNING_ADDED_TO_BODY){var getElementByTagName=function(elt,name){var elements;try{elements=elt.selectNodes(".//*[local-name()=\""+
      name+"\"]");}catch(ex){try{elements=elt.getElementsByTagName(name);}catch(nf){}}
      return elements;};var f=function(){if(window.RICH_FACES_EXTENDED_SKINNING_ON){var styles=getElementByTagName(document,'link');if(styles){var l=styles.length;for(var i=0;i<l;i++){var elt=styles;resetMedia(elt);}}}};if(window.addEventListener){window.addEventListener("load",f,false);}else{window.attachEvent("onload",f);}
       window._RICH_FACES_SKINNING_ADDED_TO_BODY=true;}
       if(!window._RICH_FACES_SKINNING_ADDED_TO_AJAX&&typeof A4J!="undefined"&&A4J.AJAX){A4J.AJAX.AddHeadElementTransformer(function(elt){if(window.RICH_FACES_EXTENDED_SKINNING_ON){if(elt.tagName&&elt.tagName.toLowerCase()=='link'){resetMedia(elt);}}});window._RICH_FACES_SKINNING_ADDED_TO_AJAX=true;}}};
      



      Any idea what's wrong ?