Results 1 to 4 of 4

Thread: Authentication Required Dialog popup unexpectedly

  1. #1
    Join Date
    Feb 2010
    Posts
    4

    Default Authentication Required Dialog popup unexpectedly

    I have a Java Web Start program that communicate with server via http invoker. The server is protected by spring security as following:

    Code:
        <sec:http realm="My App">
            <sec:http-basic />
            <sec:intercept-url pattern="/remoting/**" access="ROLE_USER" />
        </sec:http>
    
        <bean id="myUserDetailsService" class="securityutil.MyUserDetailsService" />
    
        <sec:authentication-manager>
            <sec:authentication-provider user-service-ref="myUserDetailsService" />
        </sec:authentication-manager>
    My RemotingBean.xml is as following:

    Code:
        <bean id="MyUserBean" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
            <property name="serviceUrl" value="http://localhost:8081/BondWMS4-war/remoting/MyUserBean"/>
            <property name="serviceInterface" value="exportBeans.MyUserBean" />
            <property name="httpInvokerRequestExecutor" value="org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />
        </bean>
    My login code is as following:

    Code:
    public tryLogin(String userName, String password) {
      Authentication auth = new UsernamePasswordAuthenticationToken(userName, password);
      SecurityContextHolder.getContext().setAuthentication(auth);
      XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("myappclient/RemotingBean.xml"));
      MyUserBean myBean = (MyUserBean) beanFactory.getBean("MyUserBean");
      try {
        UserInfo userInfo = myBean.getUserInfo(userName, password);
        if (userInfo != null) {
          JOptionPane.showMessageDialog(this, "Login Successful.");
        } else {
          JOptionPane.showMessageDialog(this, "Login failed!");
        }
      } catch (Exception e) {
        JOptionPane.showMessageDialog(this, "Login failed!");
      }
    }
    If user key in wrong password, a "Authentication Required" dialog by java will popup, and if the user key in correct password this time. My program will show Login failed dialog. This will confuse user.

    Please tell me how to suppress "Authentication Required" dialog or get authentication info from "Authentication Required" dialog.

    If you have better authentication solution, please tell advice.

    Thanks in Advance.

  2. #2
    Join Date
    Mar 2008
    Posts
    12

    Default

    Did you get solution to suppress the authentication popup in this case. I am also facing the same issue and if you have the solution please suggest.

    Thanks in Advance !

  3. #3
    Join Date
    Nov 2010
    Posts
    1

    Default

    I am also facing this problem. I am using JaxWsPortProxyFactoryBean to access secure web-service. If I set a wrong username/password then I get this ugly window.

    It only happens when the application is deployed with Java Web Start

  4. #4

    Arrow

    Go through the following link may help.

    http://oaklandsoftware.com/papers/ntlm.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •