Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
JSAPI login with RESTAPI authId
amozharovskyi
<p>Hi, </p>
<p> </p>
<p>I have a problem with using tutorial <a data-ipb='nomediaparse' href='
http://developer.actuate.com/be/documentation/ihub31-dev/AIG-main/index.html#page/aig/REST-tutorial-visualization.html#'>http://developer.actuate.com/be/documentation/ihub31-dev/AIG-main/index.html#page/aig/REST-tutorial-visualization.html#</a></p>
;
<p> </p>
<p>using Ihub 3.1 f-type</p>
<p> </p>
<p>Just copied and paste html at the end of the page to a new file, changed "<span style="color:rgb(42,0,255);font-family:'Courier New', Courier, mono;font-size:13.3333330154419px;background-color:rgb(247,247,247);">mymachine</span>" to my iHub's address. Then opened created file in Chrome web browser. (.html file attached
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p><span style="font-family:calibri, sans-serif;"><span style="font-size:11pt;">The REST API needs to have all calls work with the machine name configured in constants.js</span></span> (C:\Actuate3\BIRTiHubVisualization\modules\BIRTiHub\iHub\RESTAPI\server\config)</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
amozharovskyi
<p>Thank you for reply, but it didn't help (or i didn't understand you).</p>
<p> </p>
<p>Changed</p>
<pre class="_prettyXprint _lang-">
HOST_NAME: "localhost.localdomain"
</pre>
<p>to</p>
<pre class="_prettyXprint _lang-">
HOST_NAME: "Ihub's host IP address"
</pre>
<p>But have the same result.</p>
<p> </p>
<p>The only thing is that after "HOST_NAME" had changed, iHub's built-in REST API documentation became working.</p>
<p> </p>
<p>Issue is still open, so <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">If somebody has any idea about solving this problem, please, let me know,</span></p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Thanks, Andrii</p>
pricher
<p>Hi,</p>
<p> </p>
<p>The only way I have made it working is when I use the machine name, not the IP address or localhost. For example, my machine name is "actuateone". My HOST_NAME in constants.js is set to "actuateone.localdomain" and all y URIs in the REST API sample code is using "actuateone.localdomain" as the server name.</p>
<p> </p>
<p>P.</p>
amozharovskyi
<p>Thank you, P. And sorry for wasting your time!</p>
<p> </p>
<p>It still does not work for my environment.</p>
<p> </p>
<p>My attempts:</p>
<ol><li>Set "my machine name" to constants.js, RESTAPI login and actuate.initialize() function (auth failed)</li>
<li>Created local domain "ihublogin" and set "myMachineName.ihublogin" as in step 1. (does not work because cannot resolve such host : "myMachineName.ihublogin").</li>
<li>Set "ihublogin" to constants.js, RESTAPI login and actuate.initialize() function (auth failed)</li>
<li>Just in case tried "localdomain" instead of "ihublogin", same result.</li>
<li>and lot of other combinations gave me the same result</li>
</ol><p>I have no idea how to implement JSAPI initialization in another way (and without hardcoding username and passwort to JS), did not find any docs for this.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>One thing I forgot to mention yesterday... In my hosts file, I also have the following entry:</p>
<p> </p>
<p>127.0.0.1 actuateone.localdomain</p>
<p> </p>
<p>If I remove that entry, the sample REST API application stops working.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
amozharovskyi
<p>Same result, does not work.</p>
<p> </p>
<p>actuate.initialize() request: </p>
<pre class="_prettyXprint _lang-">
http://amozharovskyi.localdomain:8700/iportal/ajaxproxy?id=v8799915320705622&key=&part=0&total=1&data=cG9zdCZhSFIwY0RvdkwyRnRiM3BvWVhKdmRuTnJlV2t1Ykc5allXeGtiMjFoYVc0Nk9EY3dNQzlwY0c5eWRHRnNMMnh2WjJsdWMyVnlkbXhsZEQ5ZlgzWndQVVJsWm1GMWJIUWxNakJXYjJ4MWJXVT0mWDE5aGRYUm9WRzlyWlc0OUpUSkdVMXBtYzJVbE1rSm5ZbU4wYWs5T1RGVWxNa0o0TmpGSFNXRXhWemRvZWxWVmExcFFOVX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UxqQXZZMmhoYm1kbFVHRm5aVVY0WVcxd2JHVXVhSFJ0YkE9PSY=
</pre>
<p>actuate.initialize() response:</p>
<pre class="_prettyXprint _lang-js">
v8799915320705622({"success":1,"responseHeaders":{"Transfer-Encoding":"chunked","Server":"server","Cache-Control":"no-cache","Vary":"Accept-Encoding","Expires":"Thu, 01 Jan 1970 00:00:00 GMT","Pragma":"no-cache","Date":"Tue, 07 Jul 2015 17:15:17 GMT","Content-Type":"text\/xml;charset=utf-8"},"status":200,"statusText":"OK","responseText":"<?xml version=\"1.0\" encoding=\"utf-8\"?><IPortalLoginResponse xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"><Message>The user name value has not been specified.\nPlease enter a valid user name.\n\n (This error can also occur if your browser has been idle for a long time)<\/Message><Status>Failed<\/Status><\/IPortalLoginResponse>"});</pre>
<p>RESTAPI login response ("AuthId" used in actuate.initialize()):</p>
<pre class="_prettyXprint _lang-js">
{
"AuthId": "/SZfse+gbctjONLU+x61GIa1W7hzUUkZP5KESEBI/lKVaIRpvRVFfvMxwvBDrLR8J3zUwN8FQfsP7MnzOFg7bq1F9kdfu9O/fllL2ekeUWxDo/71AswOXTB8ki96DuydxpEYb2u3DuiPOc0DVGXu+0k7uKp7ywHxKnTusxUEIoVZQI5qn05nZPI3FfxevVARMsKO8ixS7X6vKCoek66V0MwGpgNDnPae0ugTNmHx094NIcTIRCFrskKzlAZgq38jVuAXNn41NpX8pEmcCWst+EaLWZw5DPOOKivbln8EB3OoOvSDiFe0qvrBNxJooSseCv1De46BctgRa+LmpsMLiOe10lt9dNcUz6KGjx2Zz/Cdu96RsYgw9BiyvuomXw5z",
"AdminRights": "Administrator",
"User": {
"Id": "100100000100",
"Name": "amozharovskyi",
"EmailAddress": "",
"HomeFolder": "/Home/administrator"
}
} </pre>
<p>constants.js</p>
<pre class="_prettyXprint _lang-js">
HOST_NAME: "amozharovskyi.localdomain"
</pre>
<p>hosts</p>
<pre class="_prettyXprint _lang-">
127.0.0.1 amozharovskyi.localdomain
</pre>
Vladyslav Shpuryk
<p>Hi guys. I also have this issue. REST api works fine. But passing reqOps with AuthId to initialize() method does not has any effect - it shows login dialog or run error callback. Have tried all your suggestions - does not help anything. </p>
<p> </p>
<p>have ihub Free Edition running on linux virtual machine on 192.168.56.101</p>
<pre class="_prettyXprint _lang-js">
function acLoad( ) {
actuate.load( "viewer" );
var reqOps = new actuate.RequestOptions( );
reqOps.setRepositoryType( actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA );
reqOps.setIServerUrl( "http://192.168.56.101:8000" );
reqOps.setVolumeProfile( "Default Volume" );
reqOps.setRESTAuthToken( authId );
actuate.initialize("http://192.168.56.101:8700/iportal" , reqOps, null, null, JSAPILoaded, JSAPINotLoaded );
}
</pre>
<p>Is it possible at all to initialize jsapi using only AuthId returned by rest login in <strong>iHub, Free Edition 3.1 ?</strong></p>
amozharovskyi
<p>Fixed as suggested here -> <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/36892-secure-jsapi-authentication/'>http://developer.actuate.com/community/forum/index.php?/topic/36892-secure-jsapi-authentication/</a></p>
;