Visualize: login/logout with SSO sample

Test plugins

HTML

<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
<!--Provide URL to visualize.js-->
<script type='text/javascript' src="http://localhost:8080/jasperserver-pro/client/visualize.js"></script>
<ul id="result"></ul>

JavaScript

var $result = $("#result");
function addMsg(text) {
    $result.append("<li>" + text + "</li>");
}
visualize({
    auth: {
        name: "joeuser",
        password: "joeuser1",
        organization:"organization_1",
        timezone: "Europe/Helsinki"
    }
}, function (v) {
    addMsg("1.done. WRONG. should not be called");
}, function (err) {
    addMsg("1.error. Good. erroback called.");
    
    visualize({
        auth: {
            name: "joeuser",
            password: "joeuser",
            organization:"organization_1",
            timezone: "Europe/Helsinki"
        }
    }, function (v) {
        addMsg("2.done Good. Auth success.");
    }, function (err) {
        addMsg("2.error. WRONG - erroback should not be called.");
    }, function (err, v) {
        addMsg("2.always. Good. always called. err: " + err + ", v: " + typeof v);
    });
}, function (err, v) {
    addMsg("1.always. Good. always called. err: " + typeof err + ", v: " + typeof v);
});