Kaazing, AngularJS & BasicChallengeHandler

Kaazing, AngularJS & BasicChallengeHandler

本文关键字:BasicChallengeHandler amp AngularJS Kaazing      更新时间:2023-09-26

我正在尝试在我们的HTML5客户端中使用Kaazing库。我已经在 java 客户端中实现了它并且它工作了。登录处理程序似乎有问题。当我调试代码时,它会在登录处理程序中以无限循环结束。行回调(new PasswordAuthentication(usr, pwd))被一遍又一遍地调用:

// Configure a Basic Challenge Handler
var basicHandler = new BasicChallengeHandler();
  basicHandler.loginHandler = function(callback) {
  callback(new PasswordAuthentication(usr, pwd));
}
JmsConnectionProperties jmsProps = new JmsConnectionProperties();
jmsProps.connectionTimeout = 1000000;
jmsProps.reconnectAttemptsMax = -1;
jmsProps.reconnectDelay = 3000;
jmsProps.shutdownDelay = 5000;
console.log("Connect to: " + url);
// Create Connection Factory
jmsConnectionFactory = new JmsConnectionFactory(url, jmsProps);
websocketFactory = jmsConnectionFactory.getWebSocketFactory();
websocketFactory.setChallengeHandler(basicHandler);
// reate Connection future handler for the result
try {
    if (connection == null) {
        var connectionFuture = jmsConnectionFactory.createConnection( function() {
            try {
                // never comes to this line!!!
                connection = connectionFuture.getValue();
                // DO SOME STUFF
                    } catch (e) {
                        console.dir(e);
                        // alert(e.message);
                    }
                });
            } else {
                try {
                    connection.close(function() { /* Closed */
                    });
                } finally {
                    connection = null;
                }
            }
        } catch (ex) {
            console.dir(ex);
        }

任何帮助将不胜感激!

问候安吉拉

用户名和密码组合是否有可能不正确,从而重新质询客户端?

相关文章:
  • 没有找到相关文章