Announcement Announcement Module
No announcement yet.
Authentication Required Dialog popup unexpectedly Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

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

        <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="" />
    My login code is as following:

    public tryLogin(String userName, String password) {
      Authentication auth = new UsernamePasswordAuthenticationToken(userName, password);
      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
    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
      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
        Go through the following link may help.