<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><HEAD><meta http-equiv=Content-Type content="text/html; charset=utf-8" /><meta name=Generator content="Microsoft Word 12 (filtered medium)" /><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-AU link=blue vlink=purple>
<P><BR /><div class=WordSection1><p class=MsoNormal>Hi Guys,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am working on integrating RT with Alfresco and I am having some difficulties with authentication. Essentially my requirement is that we can get something very similar to the saved search dashlet from RT into an Alfresco Share dashlet. As the two services are not hosted on the same box I am using the REST API to do this.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In my original testing, using a REST client rather than a browser, I was able to follow the wiki instructions to download a cookie for my user, save it and pass it in the request, this works fine. When I came to trying to implement this in code I hit two problems, one is figuring out how I can send the cookie with xmlhttprequest (this is not the normal javascript xmlHttpRequest, rather Nathan McMinn's contributed class from http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-web-services-from-alfresco-web-scripts). The second issue is that to get the cookie in the first place I need the plaintext password of the user.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For now I have developed my dashlet using a newly created user: RESTuser, who has very restricted rights to actually affect tickets but can see them from all queue's. I pass the user and pass values for this user with the request (which I know is entirely insecure, however at least in this case the javascript is server side). This is OK for the time being as RT and Alfresco still see very restricted use within the company, however before we go production I need this to be set up in such a way that the tickets someone views in their dashlet are ticket's that their user account has rights to view. Both Alfresco and RT authenticate off the same AD so the usernames will always be the same.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I see a few possible ways to implement this. First to mind is that I could attempt to make a change to the REST interface allowing me to add a get parameter like restrictUser=JohnDoe and have RT do the rights calculation. Or I could attempt to build in some logic into the Share dashlet to at least filter by queue based on Alfresco security groups, but keeping the non-AD groups synced between RT and Alf feels like a nightmare waiting to happen.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So does anyone see an easier way to figure this out? I am leaning towards the former of the two options above but I am just getting my foot into the perl pool so I am not sure how successful I'll be.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-family:"Arial","sans-serif"'>Regards<o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p></div> 
<BR />
<TABLE style="WIDTH: 473px; HEIGHT: 165px" border=0 cellSpacing=0 cellPadding=0 width=473>
  <TBODY>
  <TR>
    <TD style="HEIGHT: 50px" colSpan=3><SPAN style="LINE-HEIGHT: 16px; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12px"><span style='font-family:Arial; font-size:11pt; font-weight: bold; '>Chris</span> <span style='font-family:Arial; font-size:11pt; font-weight: bold; '>O'Kelly</span><BR /><SPAN style="FONT-SIZE: 14px"><B><span style='font-family:Arial; font-size:9pt; font-weight: normal; '>Web Administrator</span></B></SPAN><BR /></SPAN></TD></TR>
  <TR>
    <TD style="WIDTH: 178px" height=112 vAlign=top width=199 align=left><SPAN style="LINE-HEIGHT: 16px; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12px"><table class=7f172dc6-f7d4-483a-a4cd-5841754651fbTable><tr><td><span style='font-family:Arial; font-size:x-small; color: #000000; font-weight: bold; '>Minecorp Australia</span></td></tr><tr><td><span style='font-family:arial; font-size:9pt; '>37 Murdoch Circuit</span></td></tr><tr><td><span style='font-family:arial; font-size:9pt; '>Acacia Ridge QLD 4110</span></td></tr><tr><td><span style='font-family:Arial; font-size:9pt; color: #0070C0; '><span style='font-family:arial; font-size:9pt; color: #0070C0; font-weight: bold; '><span style='font-family:arial; font-size:9pt; color: #0070C0; font-weight: bold; '><a href='http://www.minecorp.com.au' title='Minecorp Vehicle Solutions' target=''><span style='font-family:arial; font-size:9pt; color: #0070C0; font-weight: bold; '>minecorp.com.au</span></a></span></span></span></td></tr></table><BR /></SPAN></TD>
    <TD style="WIDTH: 290px" height=112 vAlign=top width=250 align=left><SPAN style="LINE-HEIGHT: 16px; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12px"><B><table class=7f172dc6-f7d4-483a-a4cd-5841754651fbTable><tr><td width=600px><span style='font-family:Arial; font-size:9pt; font-weight: bold; '>P:   07 3723 1000</span></td></tr><tr><td width=600px><span style='font-family:Arial; font-size:9pt; font-weight: bold; '>M:  0450 586 190</span></td></tr><tr><td width=600px><span style='font-family:arial; font-size:9pt; font-weight: bold; '>E:  <a href='mailto:Chris.okelly@minecorp.com.au' title='Click to send email to Chris O'Kelly' target=''>Chris.okelly@minecorp.com.au</a></span></td></tr><tr><td width=600px><span style='font-family:Arial; font-size:9pt; color: #4F81BD; font-weight: bold; '>S:  <a href='http://skype.com' title='' target=''>chris.okelly.mvs</a></span></td></tr></table><BR /></B></SPAN></TD></TR></TBODY></TABLE> <IMG id=IMG1 border=0 src="http://oi46.tinypic.com/mw8nbd.jpg" width=430 height=132 /><BR /><BR /> 
</P></BODY></HTML>