gesulmino Posted September 19, 2018 Share Posted September 19, 2018 Hi, how to call another web application uniGUI? Is it possible to avoid to start a new session, or at least without logging in again? thanks. Quote Link to comment Share on other sites More sharing options...
wprins Posted September 19, 2018 Share Posted September 19, 2018 1 hour ago, gesulmino said: Hi, how to call another web application [in] uniGUI? Is it possible to avoid to start a new session, or at least without logging in again? thanks. I assume you meant to write it as the above (note I inserted [in]). What do you mean by "another web application" and what do you mean by "call" exactly? You can call other web services in the normal way you would from non uniGUI applications by whatever means suits your purpose. You can also "call" and frame another website inside a uniGUI frame, with some work and some co-operation from the site being called/framed. You could call a uniGUI application in various ways as well, though you'd need to arrange things to suit your purpose, which is to say you'll have to arrange for the required credentials/login to be somehow handled seamlessly/in the background. (We do something like this from an iSeries green screen system which publishes a clickable URL on the green screen and it directly "calls" our UniGUI application, taking the user to a specific page/form in the UniGUI application. If the user isn't already logged in then they're prompted to log in, after which of course the browser knows the user and further logins is seamlessly handled as required.) Quote Link to comment Share on other sites More sharing options...
gesulmino Posted September 20, 2018 Author Share Posted September 20, 2018 Hi, thanks for the answer, //how to call another web application uniGUI? I have an uniGUI application (http://localhost:8077/) that do user login and other ancillary operations. In a menù when I select an item then I will open another uniGUI application (http://localhost:8078/) on a new tab in the browser, starting new session but without logging in again. Quote Link to comment Share on other sites More sharing options...
Ron Posted September 20, 2018 Share Posted September 20, 2018 This you can solve by adding some URL parameters, which you then pick up and use for automatic login. This may include some random code which has a time limit and may only be used once for login, and gets cleared in the db afterwards. Quote Link to comment Share on other sites More sharing options...
gesulmino Posted September 20, 2018 Author Share Posted September 20, 2018 1 hour ago, delphidude said: This you can solve by adding some URL parameters, which you then pick up and use for automatic login. This may include some random code which has a time limit and may only be used once for login, and gets cleared in the db afterwards. Hi, thanks for the help. /********************************************************** on the main form, in onClick item application url list I run the command //UrlAPP=http://localhost:8078 //NomeLogin=username value //Password=password value UniSession.AddJS( 'var f = document.createElement("form"); '+ 'f.action="'+UrlAPP+'"; '+ // the second app url 'f.method="POST"; '+ 'var i=document.createElement("input"); '+ // username 'i.type="hidden"; '+ 'i.name="nomelogin"; '+ 'i.value="'+NomeLogin+'"; '+ 'f.appendChild(i); '+ 'var i2=document.createElement("input"); '+ // password 'i2.type="hidden"; '+ 'i2.name="password"; '+ 'i2.value="'+Password+'"; '+ 'f.appendChild(i2); '+ 'document.body.appendChild(f); '+ 'f.submit(); ' ); /******************************************** in MainModule, in the event OnBeforeLogin, I check the post parameters if UniSession.UniApplication.Parameters.Values['nomelogin'] <> '' then begin if not IsValidAccount(UniSession.UniApplication.Parameters.Values['nomelogin'], UniSession.UniApplication.Parameters.Values['password'], Date) then Handled := false else Handled := true end else begin Handled := false end /***************************************************** can it be a good solution? I'd like the url to be opened in a new tab, how could I do it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.