<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Problem with Rest Interface in JBPM 5.2
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/meyerschalk">Dirk Meyer</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/740162#740162">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Here is some web sites for you to read - <a class="jive-link-external-small" href="http://docs.oracle.com/javaee/1.4/tutorial/doc/Security5.html">http://docs.oracle.com/javaee/1.4/tutorial/doc/Security5.html</a> and <a class="jive-link-external-small" href="http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch8.chapter.html">http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch8.chapter.html</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Basically in the gwt-console-server the rest services is expost and use form base authentications - so what happen is that you have called a secure web pages, and are redirected to a page to ask you your user credentials - </p><p>The authentication screen ask you to do a http "Post" on the submit to the j_security_check ( with the post you are forced to pass the j_username and j_password variables as parameters - in a get the call would habe looked something like this</p><p>&#160; <a class="jive-link-external-small" href="http://localhost:8080/gwt-console-server/rs/process/j_security_check?j_username=admin&amp;j_password=admin" target="_blank"><span style="color: #355491;">http://localhost:8080/gwt-console-server/rs/process/j_security_check?j_username=admin&amp;j_password=admin</span></a></p><p><span style="color: #355491;"> you have to do this with on the same httpclient otherwise you will get a timeout. </span></p><p><span style="color: #355491;">S<a class="jive-link-anchor-small">#</a>o all Form base pages will have this behaviour.. </span> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div class="mcePaste" id="_mcePaste" style="position: absolute; top: 0px; left: 0px;"></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>in my code it look something like this</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt;"><p align="left">String secUrl = _jbpmRest+<span style="color: #2a00ff; font-size: 10pt;">"/process/j_security_check"</span><span style="font-size: 10pt;">;</span><span style=": ; font-size: 2;"><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><em style="color: #0000c0; font-size: 10pt;"><em style="color: #0000c0; font-size: 10pt;">logger</em></em><span style="font-size: 10pt;">.info(</span><span style="color: #2a00ff; font-size: 10pt;">"start sec <span style="color: #2a00ff; font-size: 2;"><a class="" href="https://community.jboss.org/------&gt;&amp;quot; secUrl &amp;quot;\n\n\n\n">url:------&gt;"</a></span></span><a class="" href="https://community.jboss.org/------&gt;&amp;quot; secUrl &amp;quot;\n\n\n\n"><span style="font-size: 10pt;">+secUrl+</span><span style="color: #2a00ff; font-size: 10pt;">"\n\n\n\n"</span></a><span style="font-size: 10pt;">);</span><span style="font-size: 2;"><p>content = authenticate(secUrl, _userId , _<span style="text-decoration: underline;">password</span>);</p></span><p>_jbpmRest is the offset to <a class="" href="https://community.jboss.org/localhost:8080/gwt-consoel-server/rs">http://localhost:8080/gwt-consoel-server/rs</a> - this is not hard coded for obvious reasons</p><p><span style="font-size: 10pt;">Basically if you are autheticated in a httpclient session then that authentication will be valid for the life of the session</span></p><p><span style="font-size: 10pt;">_userid, and _password is the authentication credential for the user I am logged in as....</span></p><p><span style="font-size: 10pt;"></span></p><p><span style="font-size: 10pt;"></span>I know that you want to get started and build some workflows, but I can suggest that get a good grounding in j2ee web applications and there are a range of free internet resources available&#160; to get started like the pages I suggest earlier. Or you can join Safari online and enjoy some of the online books they have available</p><p><span style="font-size: 10pt;"></span></p><p><span style="font-size: 10pt;"></span>I hope this help. .&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="font-size: 10pt;"></span></p></p></span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/740162#740162">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>