Security with Headless Client

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Security with Headless Client

Postby Westy » Wed Jan 12, 2005 4:37 am

How does Servoy security work with the Headless Client?
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby IT2Be » Wed Jan 12, 2005 7:37 pm

as far as I know exactly the same where applicable. If security is set you log in with a user. The rest is up to you!
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Westy » Thu Jan 13, 2005 1:43 am

I tried that last night but setting Servoy security settings appeared to break the Headless Client. After I removed the require password setting, which I assumed was causing the problem, Servoy would hang when I opened the head (browser) and then closed it. Servoy did not appear to be aware that the browser was closed.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby IT2Be » Thu Jan 13, 2005 10:17 am

Hmm, there must be something wrong but I can't imagine it is the security system because this works for me without any issues... Do you have a logging or something like that?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby jcompagner » Thu Jan 13, 2005 11:10 pm

you dit suplly the username/password when intializing the headless client?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby idoctor » Fri Jan 28, 2005 9:54 am

Previously posted in the wrong place:


Example of a simple contact management database fit for a PDA browser can be viewed at 149.142.139.141:8080/1.

Headless client is very cool.


John McCann

I have security set on the above example and it does not request that I log in when I go to the URL. Is thier some way to force log in?

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby jcompagner » Fri Jan 28, 2005 5:09 pm

Are you saying that you have a solution where you checked the require login box.
And that you can access them without username/password specified when creating a headless client?

You should get an can't login error when initation..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Westy » Fri Jan 28, 2005 10:50 pm

Can we see the code for the simplelistview.jsp file? Other steps required to make it work? He asks excitedly.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby bcusick » Fri Jan 28, 2005 11:52 pm

Here you go:

Code: Select all
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<%
   ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
   if (servoy_hc == null)
   {
      servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_01");
      session.setAttribute("servoy",servoy_hc);
   }
   boolean ok = servoy_hc.setMainForm("customers");
   if (!ok)
   {
      servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_01");
      session.setAttribute("servoy",servoy_hc);
   }
   String custid = request.getParameter("custid");
   String pageid = request.getParameter("pageid");
   if (null==pageid) pageid = "1";
   String filter = request.getParameter("filter");
   String showOrders = request.getParameter("showOrders");
%>
<html>
<head>

<style type="text/css">
<!--
body {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 24px;
   color: #333333;
}
a{
   text-decoration: none;
   font-size: 11px;
   font-family:  verdana, sans-serif;
}
A:link
{
   color: #036;
}

A:visited
{
   color: #036;
}

A:active
{
   text-decoration: underline;
   color: #F90;
}

A:hover
{
   text-decoration: underline;
   color: #F90;
}

td
{
   font-size: 11px;
   border-color: #CCCCCC;
   border-width: 1;
   border-style: solid;
}
td.sub
{
   background-color: #003366;
   color: #FFFFFF;
}
td.red
{
   background-color: #990000;
   color: #FFFFFF;
}
table
{
   border-color: #CCCCCC;
   border-width: 1;
   border-style: solid;
}
td.lg
{
   color: #FFFFFF;
   background-color: #999999;
}
.small
{
   font-size: 10px;
}
.x-small
{
   font-size: 8px;
}
-->
</style>

<title>Servoy Headless Client test</title>
</head>
<body onload="javascript:document.searchform.filter.focus()">
  <%
   String theTable = "";
   if(null==custid || null != filter)
   {
      theTable= (String)servoy_hc.executeMethod(null,"getList",new Object[]{pageid,filter});
   }
   else if(null==showOrders)
   {
       theTable = (String)servoy_hc.executeMethod(null,"getDetails",new Object[]{custid,pageid});
   }
   else
   {
      theTable = (String)servoy_hc.executeMethod(null,"getOrders",new Object[]{custid,pageid});
   }
   out.println(theTable);


%>

<br><font class="small">Company, Name or City:</font><form action="" method="post" name="searchform"><input name="filter" type="text" class="lg" id="filter" size="20" maxlength="10" onBlur="javascript:if (this.value.length>0) document.searchform.submit()"></form>

</body>
</html>


Most of the "hard" work is done in the solution itself - it returns the HTML to display from methods that run in the solution.
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby bcusick » Sat Jan 29, 2005 12:19 am

I've put together the simplelistview.jsp sample and solution. You can download from here:

http://developer.servoy.com/downloads/headless_client_examples.zip

Hope this helps.
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby Westy » Sat Jan 29, 2005 12:50 am

Great. Thank you very much! :D
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby idoctor » Sat Jan 29, 2005 5:27 am

Are you saying that you have a solution where you checked the require login box.
And that you can access them without username/password specified when creating a headless client?

You should get an can't login error when initation..


Johan,

I went back and looked at it more closely. I made the the little headless client application a module. I did not realize one needs to set secuirty in a module seperate from the main application. When I flip the flag for log on required in the module I am no longer allowed to log on to the headless client. This is very cool for playing with but without security I cannot use it for what I need over the WWW. So how, or when will I be able to get the log on screeen using the headless client? Come on. You guys came up with this idea over a week ago. It should be completely polished by now.


John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby jcompagner » Mon Jan 31, 2005 12:04 am

if youre users must login before opening the solution. Then you have to make youre login dialog yourself. So create a jsp page before making the sessionclient and with the input of the first login page you make the session client with the user/password you got.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Westy » Sun Feb 20, 2005 6:13 pm

jcompagner wrote:if youre users must login before opening the solution. Then you have to make youre login dialog yourself. So create a jsp page before making the sessionclient and with the input of the first login page you make the session client with the user/password you got.

What is the proper syntax in order to include the username and password when making the session? A sample of what you describe would be really helpful.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby IT2Be » Mon Feb 21, 2005 10:47 am

All documented here:

http://developer.servoy.com/docs/headle ... index.html

take a look at 'HeadlessClientFactory'...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 5 guests

cron