5 Replies Latest reply on Jan 7, 2015 9:38 AM by Manuel Schatzl

    JBoss7.1.1.Final Security port to Wildfly 8.2.Final

    Manuel Schatzl Newbie

      hello jboss community!

       

      i ve written my own login module and cant get it running on wildfly...(i need some stuff from java8 so ive to update..) on jboss7 everything works just fine, but on the wildfly side i always get an 401 error...

       

      what i mean is - that i dont believe that my application server does use my login module, because nothing shows up in the log..

       

      Log after start and trying to log in with my android client (which works with Volley.. a http library from google)

      10:01:22,871 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 31) JBAS018559: Deployed "server-wildfly-ear.ear" (runtime-name : "server-wildfly-ear.ear")
      10:01:22,948 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
      10:01:22,948 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
      10:01:22,949 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 4927ms - Started 471 of 536 services (122 services are lazy, passive or on-demand)
      
      

      sure.. basic log after starting the server..

       

      and nothing then a "401 forbidden" on client side:

      12-11 10:05:47.523: E/Volley(27433): [2623] BasicNetwork.performRequest: Unexpected response code 401 for https://10.0.0.202:8443/server-wildfly-web/rest/userinfo/get_some_information
      
      

      (same with my internet explorer)

       

      my web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
            version="3.0">
      
      
        <module-name>server-wildfly-web</module-name>
      
      
        <security-constraint>
              <web-resource-collection>
                   <web-resource-name>users</web-resource-name>
                  <url-pattern>/rest/userinfo/*</url-pattern>
              </web-resource-collection>
           
              <auth-constraint>
                  <role-name>user_role</role-name>
              </auth-constraint>
           
              <user-data-constraint>
                  <transport-guarantee>CONFIDENTIAL</transport-guarantee>
              </user-data-constraint>
          </security-constraint>
      
      
          <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>my_auth</realm-name>
          </login-config>
      
      
          <security-role>
              <role-name>admin</role-name>
          </security-role>
          <security-role>
              <role-name>user</role-name>
          </security-role>
          <security-role>
              <role-name>user_role</role-name>
          </security-role>
      </web-app>
      
      

       

      jboss-web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
          <security-domain>my_auth</security-domain>
          <valve>
              <class-name>com.test.server_wildfly.security.CustomAuthenticator</class-name>
          </valve>
      </jboss-web>
      
      

       

      standalone security realm: (full.xml)

      <security-realm name="MyRealm">
                      <server-identities>
                          <ssl protocol="TLS">
                              <keystore path="server.jks" relative-to="jboss.server.config.dir" keystore-password="password"/>
                          </ssl>
                      </server-identities>
                  </security-realm>
      
      

       

      standalone security domain: (full.xml)

      <security-domain name="my_auth" cache-type="default">
                          <authentication>
                              <login-module code="com.test.server_wildfly.security.CustomLoginModule" flag="required"/>
                          </authentication>
                      </security-domain>
      
      

       

      standalone ssl/tls stuff: (full.xml)

      <server name="default-server">
                      <http-listener name="default" socket-binding="http"/>
                      <https-listener name="https" socket-binding="https" security-realm="MyRealm"/>
      
      

       

      something must be wrong with the config, as i said jboss7 is no problem

       

      maven dependency for the wildfly project: (for the login module stuff)

      <dependency>
          <groupId>org.picketbox</groupId>
          <artifactId>picketbox</artifactId>
          <version>4.0.21.Final</version>
      </dependency>
      
      

       

      what i also tryed was:

      1) <default-security-domain value="other"/> - to my security domain "my_auth"

      2) removed valve from jboss-web.xml - because it isnt used?

      3) used another picketbox version

      4) remove everything from web.xml - which turned off, obviously, the login stuff so its deff. a configuration problem

      5) tryed wildfly8 and 8.1 too

       

      any advice? thank u very much