Avoiding manual login

From pmusers
Jump to: navigation, search

ProcessMaker doesn't allow a user to enter the program without a valid login. Users can start new cases using Web Entry without logging into ProcessMaker and external users can follow cases using the Case Tracker. Otherwise, a valid login is needed to access ProcessMaker through the graphical interface. This page explains some workarounds to allow users to access ProcessMaker without manually logging in.

Access ProcessMaker through Email

One way to avoid the manual login is to use the Actions By Email feature in the Enterprise Edition to send emails to users and have them submit forms from their email. Programmers using the Community Edition can implement similar functionality using Web Services or REST. Of course, Actions By Email doesn't provide a way to view the case lists, but it may be a solution for a user who only needs to submit information to cases.

Custom interface using Web Services or REST

Programmers can create their own interface in a custom web page, app, etc. which automatically logins as a registered user using web services or oauth2 for REST. Then, web services or REST can be used to retrieve information from ProcessMaker and display it in the custom interface. Likewise, cases can be executed through the custom interface.

Automatic Login using the Session ID

The session ID from a login session can be attached to a URL inside ProcessMaker to access that page without manually logging in. First, create a user with a username such as "anonymous" who will be used to login. Then, create code which calls web services' login() to obtain the session ID for a login session. Then, redirect the web browser to a URL inside processmaker which has &sid=session-id attached to the end of it. See: to obtain the session ID and attach that session ID to the URL to bypass the login screen. See: Automatic Login with Web Services.

If which to use REST instead of web services, then install the extraRest plugin and use the GET extrarest/session-id endpoint to obtain the session ID.

Modify the source code to automatically login

The easiest way to avoid manual logins is to modify the ProcessMaker source code to automatically login as a registered user. For example, create a new user with the username "anonymous" and the password "p4sSw0rD".

Then, edit the source code of the workflow/engine/xmlform/login/loginpm3.html file with a plain text editor and change lines 37-39 from:

<script type="text/javascript">
    try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
</script>

To:

<script type="text/javascript">
    try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
    {literal}
    document.getElementById("form[USR_USERNAME]").value="anonymous";
    document.getElementById("form[USR_PASSWORD_MASK]").value="p4sSw0rD";
    setTimeout( function() { 
       if (document.getElementById("form[USR_USERNAME]").value == "anonymous") {
          document.getElementById("form[BSUBMIT]").click(); 
       }
    }, 10000); 
    {/literal}
</script>

This code will automatically login the user as "anonymous" after a 10 second delay, so that normal users will have time to login first. To login immediately, change 10000 to 0.