- Enabling the SaaS implementation
- Connection mode
- Page for automatic connection
- Page for custom connection
- Checking the authorizations
- Customizing a SaaS site
- Configuring the test mode
- Using a WEBDEV Application Server (limited or not to 10 connections)
- Using a local SaaS server
A SaaS site is developed as a standard WEBDEV site.
Some additional operations must be performed:
Enabling the SaaS implementation
To enable the implementation of the SaaS features in the project:
- On the "Project" tab, in the "Project" group, click "Description".
- In the "Project" tab, check "SaaS site (Software as a Service)":
- Specify (if necessary) the name of the Application Server (or the full address of the SaaS Webservice) that will be used for the test mode.
To use the local SaaS server, no address must be specified.
For more details, see Configuring the test mode.
- Specify the connection mode:
- Check "Use the "Automatic connection" mode" to use the integrated connection mode of WEBDEV.
- Uncheck this box if you want to customize the page for connecting to the application.
For more details, see Connection mode
Page for automatic connection
When a SaaS site is using the page for automatic connection, the WEBDEV Application Server generates a page that allows the user to connect to the site.
This page takes the following operations into account:
- Typing the login and password.
- A link is used to manage the forgotten password. In this case, an email is sent to the user with the correspondingt security code.
Caution: to use this feature, the email address of the user must be filled and the SaaS administrator must be configured for sending emails by SMTP.
- After 3 attempts for typing the password, the input of a captcha is requested in addition to the password for identification.
- Call to SaaSConnect to check the authentication information.
- Checking whether the user owns a license for at least one service supplied by the site.
- Automatically changing the connection of all the data files for the site analysis.
This change is equivalent to the following code:
Benefits of this method:
- If the site defines a single service, there is nothing to program.
- Quick test for switching a site to SaaS.
- Ability to improve the result of automatic calls by using HChangeConnection or SaaSCheckService in the site.
Page for custom connection
If the mechanism for automatic connection is not used, a mechanism must be implemented on one of the site pages to allow the authentication of the user toward the SaaS Webservice.
The connection page must:
- Call SaaSConnect to establish the connection to the SaaS Webservice.
- Check the services that can be used by the user (SaaSCheckService).
- Change the connection for the data files of the analysis by using HChangeConnection. The connection information of the current SaaS user can be retrieved by SaaSClientConnexion.
Benefits of this method:
- Ability to customize the connection page.
- The connection page is not necessarily the first page of the site. You can have a "public" section visible by everyone and a "private" section accessible to the authenticated users.
- Even the public section of a site may require a call to SaaSConnect (by using a "guest" identifier) in order to allow the customization of the user interface via to the parameters associated with the SaaS client account. For more details, see Customizing a SaaS site.
- We advise you to access the connection page by using the HTTPS protocol in order to avoid having authentication information travel in clear over the network.
- To increase the security of the SaaS site, the Webservice can be installed on a computer that is not accessible publicly but only from the WEBDEV Application Server that is hosting the SaaS site. Therefore, the requests made to the Webservice cannot be intercepted.
Checking the authorizations
You can segment the different features offered by a SaaS site by declaring services in the SaaS administrator
. These services are made available to the users via a pricing. A pricing groups one or more services. The user accounts subscribe to the pricing and distribute the licenses to their users.
to check if the logged-in user has a license for a site functionality.
For example, you can display an error message and redirect the user. SaaSCheckService
is used in the initialization code of a page as follows:
// Checks whether the user is allowed to add new incidents into the database
IF SaaSCheckService("Adding incidents") = False THEN
Error("Your subscription level does not allow you to add new incidents.")
You can also hide the elements that cannot be accessed by the user:
// Hides the chart of statistics
// if the subscription of the current user does not include the "statistics" service
CHART_Stat.Visible = SaaSCheckService("statistics")
Even in sites that offer a limited number of services, it is always useful to declare constants that correspond to the names of the services, to avoid typos in the calls to SaaSCheckService
The GUI and the operating mode of a SaaS site can be customized for each client account. This customization can be done as follows:
- Caption depending on the client account.
- Images specific to each client account.
- Internal operating mode (site algorithms) depending on the client account.
The administrator of the SaaS system can define one or more parameters for each site declared in the SaaS administrator
. These parameters (identified by their names) can be read again in the code of the site via SaaSReadSiteParameter
to change the site's behavior.
- Configuring the logo and title of site pages
This code can be used in a page template, found in each site page.
// Configure the GUI of the SaaS site
IMG_Logo = SaaSReadSiteParameter("LogoImage")
EDT_Title = SaaSReadSiteParameter("ClientTitle")
In this example, all you have to do is declare "LogoImage" and "ClientTitle" as being parameters of site and customize their value for each client account.
- Configuring the algorithm of the site
bIsAPro is boolean
bIsAPro = SaaSReadSiteParameter("ProAccount")
IF bIsAPro = True THEN
In this example, the "ProAccount" parameter specifies whether the client account references a professional user or a standard user and a specific process is called according to this information.
Configuring the test mode
Several configurations can be used to start a SaaS site in test mode:
- Using a WEBDEV Application Server.
- Using a WEBDEV Application Server for test (limited to 10 connections).
- Using a local SaaS server.
Using a WEBDEV Application Server (limited or not to 10 connections)
To use a WEBDEV Application Server in test mode, you must specify:
- its name (or IP address) in the corresponding field of the project description window ("Project" tab, "Project" group, "Description").
- the full URL of the Webservice (if you want to use the HTTPS protocol for example).
Using a local SaaS serverTo use a local WEBDEV Application Server in test mode, no address must be specified for the SaaS server in the project description.
To start the local SaaS administrator, go to the "Tools" tab, "Web utilities" group and click "WDAdminSaaS".
Training (WEBDEV): WW_SAASClientSite