0 Replies Latest reply on Jun 7, 2013 7:42 AM by Dias Raja

    Authentication Required

    Dias Raja Newbie

      Hi,

       

      I am using jboss-as-7.1.1.Final.

       

      My web.xml is like below

       

      <web-app id="WebApp_ID" version="2.4"

          xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

          http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

          <display-name>Restful Web Application</display-name>

       

          <!-- <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value>

              </context-param> -->

       

          <context-param>

              <param-name>resteasy.resources</param-name>

              <param-value>com.mkyong.rest.JSONService</param-value>

          </context-param>

       

          <listener>

              <listener-class>

                  org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>

          </listener>

          <servlet>

              <servlet-name>resteasy-servlet</servlet-name>

              <servlet-class>

                  org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>

          </servlet>

       

          <servlet-mapping>

              <servlet-name>resteasy-servlet</servlet-name>

              <url-pattern>/*</url-pattern>

          </servlet-mapping>

       

          <security-constraint>

              <web-resource-collection>

                  <web-resource-name>MySecureResources</web-resource-name>

                  <description>Some Description</description>

                  <url-pattern>/*</url-pattern>

                  <http-method>GET</http-method>

                  <http-method>POST</http-method>

              </web-resource-collection>

              <auth-constraint>

                  <role-name>TestRole</role-name>

              </auth-constraint>

          </security-constraint>

          <login-config>

              <auth-method>BASIC</auth-method>

              <realm-name>MyRealm</realm-name>

          </login-config>

          <security-role>

              <role-name>TestRole</role-name>

          </security-role>

      </web-app>

       

      My jboss.xml is like below

      <jboss-web>

          <security-domain>java:/jaas/cxfservice-security-domain</security-domain>

      </jboss-web>

       

      My property files are

      1.cxfservice-roles.properties

                userone=TestRole

      2.cxfservice-users.properties

                userone=passwordone

       

      As am run my code it ask username and password I give username as "userone" and password as "passwordone" it show the error as I mentioned below.

       

      My error is like below

       

      17:04:47,140 ERROR [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http-localhost-127.0.0.1-8080-1) Login failure: javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required

          at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:270) [picketbox-4.0.7.Final.jar:4.0.7.Final]

          at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:155) [picketbox-4.0.7.Final.jar:4.0.7.Final]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_17]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_17]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_17]

          at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext.invoke(Unknown Source) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext.access$000(Unknown Source) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext$4.run(Unknown Source) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext$4.run(Unknown Source) [rt.jar:1.7.0_17]

          at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext.invokePriv(Unknown Source) [rt.jar:1.7.0_17]

          at javax.security.auth.login.LoginContext.login(Unknown Source) [rt.jar:1.7.0_17]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.defaultLogin(JBossCachedAuthenticationManager.java:449) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.proceedWithJaasLogin(JBossCachedAuthenticationManager.java:383) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.authenticate(JBossCachedAuthenticationManager.java:371) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.isValid(JBossCachedAuthenticationManager.java:160) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

          at org.jboss.as.web.security.JBossWebRealm.authenticate(JBossWebRealm.java:214) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:455) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_17]

       

       

      Please any one help me to solve this Issue.

       

      Thanks & regards,

      A.Dias