☰
Current Page
Main Menu
Home
Home
Editing Logging-In
Edit
Preview
H1
H2
H3
default
Set your preferred keybinding
default
vim
emacs
markdown
Set this page's format to
AsciiDoc
Creole
Markdown
MediaWiki
Org-mode
Plain Text
RDoc
Textile
Rendering unavailable for
BibTeX
Pod
reStructuredText
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
#Security Design Guide - Section 2: Logging in [[_TOC_]] ##Introduction Izenda, out of the box, does not come with a log-in mechanism. However, there variables and functions set up to allow you to authenticate Izenda based on your application's log-in process. For those who are using a stand-alone version, we recommend creating a log-in page. Although Izenda comes with a sample log-in page, it should only be used as a guide and customized for your use cases. ##Tips and Best Practices * Common ways to deliver authentication from your application are session variables and cookies. Other methods can be used as long as they are able to populate Izenda's variables within the InitializeReporting method. * When integrated, common information that we recommend be passed to Izenda includes the User Name, Tenant ID, Admin or Not and Roles. * The boolean [RequireLogin](http://wiki.izenda.com/API/CodeSamples/RequireLogin) only asserts that the [CurrentUsername](http://wiki.izenda.com/API/CodeSamples/CurrentUserName) is not null or the Izenda default. When it is one of these, the user will be redirected to whatever location is set in the [LoginUrl](http://wiki.izenda.com/API/CodeSamples/LoginUrl) variable. * There is a sanity check within the InitializeReporting function to ensure that initializtion is run once. We recommend putting code that sets the user outside of this so that it is run every page change. This will ensure that the user hasn't changed and they will only see whatever data they are allowed to see. ##Example Log-In Logic ```csharp bool AuthenticateUser(string userName, string password, out bool isAdmin) { DataSet ds = AdHocContext.Driver.GetDataSet(AdHocContext.Driver.CreateCommand(string.Format("select 1 from employeeLogin where userName = '{0}' and password = '{1}'",userName,password))); isAdmin = false; string validated = ds.Tables[0].Rows[0][0].ToString(); if (userName.ToLower() == "admin" || userName.ToLower() == "administrator") isAdmin = true; if (validated.Equals("1")) return true; else return false; } void Button1_Click(object sender, EventArgs args) { try{ loginValidator.IsValid = true; bool isAdmin; if (AuthenticateUser(userNameTextbox.Text, userPassword.Value, out isAdmin)) { HttpContext.Current.Session["UserName"] = userNameTextbox.Text; if (isAdmin) HttpContext.Current.Session["Role"] = "Administrator"; else HttpContext.Current.Session["Role"] = "RegularUser"; FormsAuthentication.RedirectFromLoginPage(userNameTextbox.Text, false); return; } loginValidator.IsValid = false; } catch(IndexOutOfRangeException e) { return; } } ```
Uploading file...
Header
 **This documentation is for the legacy Izenda 6 product. Documentation for the new Izenda 7 product can be found at [[https://www.izenda.com/docs/|https://www.izenda.com/docs/]]**
Sidebar
 --- * [[Installing Izenda on Windows Server|http://wiki.izenda.com/Guides/Installing-Izenda]] * [[Installing Izenda on Mac|/Guides/Mac-Install]] * [[Connecting to the Database|/Integration/Tutorials/connect-to-the-database]] * [[User Guides|http://wiki.izenda.com/Guides/ReportDesign]] * [[Developer Guides|Guides/Developer Links and Guides]] --- * [Izenda Website](http://www.izenda.com) * [Product Video](http://www.izenda.com/Site/Video/ProductVideo.aspx) * [Izenda Blog](http://www.izenda.com/blog) * [Company Page](http://www.izenda.com/company) * [Gallery](http://www.izenda.com/izenda-vision/) * [Client List](http://www.izenda.com/case-studies/) * [Contact Page](http://www.izenda.com/contact-us/) * [Knowledge Base](http://www.izenda.com/Site/KB/Integration/94) --- * [[Acknowledgements]]
Edit message:
Cancel