Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
titleColorwhite
titleBGColor#9b4d4d
titleIMPORTANT NOTICE

The sample code provided below using Javascript that exposes the user credential information is not a good security best practice. Please do not put this into practice.


  • User logs in to external system and implicitly gains access to Joget Workflow without being prompted to login again.
  • Used with JavaScript API
  • Perform actions in callback of successful login

    Code Block
    langjavascript
    <script type="text/javascript" src="http://localhost:8080/jw/js/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="http://localhost:8080/jw/js/json/util.js" ></script>
    
    <script type="text/javascript" >
    $(document).ready(function(){
        var loginCallabckloginCallback = {
            success : function(response){
                if(response.username != "roleAnonymous"){
                    alert("login successfully");
                }else{
                    alert("login fail");
                }
            }
        };
        AssignmentManager.login('http://localhost:8080/jw', 'admin', 'admin', loginCallback);
    });
    </script>