bb4d956d5e139fa79676cef010ceaefe8785d7e3
Home.md
| ... | ... | @@ -43,12 +43,12 @@ The Izenda Reports platform includes a robust and flexible security model which |
| 43 | 43 | |
| 44 | 44 | For demonstration purposes, we will be working with the following information: |
| 45 | 45 | |
| 46 | +* The user has already been authenticated with the application Izenda is embedded into |
|
| 46 | 47 | * The username is stored in a session variable called "UserName" |
| 47 | 48 | * The tenant ID is stored in a session variable called "TenantID" |
| 48 | 49 | * The user's role is stored in a session variable called "Role" |
| 49 | 50 | * The user's country name is stored in a session variable called "UserCountry" |
| 50 | 51 | * The database contains tables and views with a field named "ClientID" |
| 51 | -* Reports will be created and saved to a category called "Admin Reports" |
|
| 52 | 52 | * A method named GetUserName() exists in global.asax that accesses the session variable "UserName" |
| 53 | 53 | * A method named GetTenantID() exists in global.asax that accesses the session variable "TenantID" |
| 54 | 54 | * A method named GetUserRole() exists in global.asax that accesses the session variable "Role" |
| ... | ... | @@ -64,10 +64,11 @@ For demonstration purposes, we will be working with the following information: |
| 64 | 64 | |
| 65 | 65 | ###Basic Login Scenario |
| 66 | 66 | |
| 67 | -In this example, we will initialize some of the more common settings. This is done in the [[PostLogin()|/FAQ/PostLogin]] or [[ConfigureSettings()|/FAQ/ConfigureSettings]] method of your ``CustomAdHocConfig`` class that we discussed earlier. This example assumes your license key has already been set previously. |
|
| 67 | +In this example, we will initialize some of the more common settings. This is done in the ``InitializeReporting()`` method of your ``CustomAdHocConfig`` class that we discussed earlier. |
|
| 68 | 68 | |
| 69 | 69 | ``` c# |
| 70 | 70 | //Pass User Credentials |
| 71 | +AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 71 | 72 | AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
| 72 | 73 | AdHocSettings.CurrentUserName = GetUserName(); |
| 73 | 74 | AdHocSettings.CurrentUserTenantId = GetTenantID(); |
| ... | ... | @@ -100,19 +101,4 @@ else |
| 100 | 101 | AdHocSettings.ShowMiscTab = false; |
| 101 | 102 | } |
| 102 | 103 | } |
| 103 | -``` |
|
| 104 | - |
|
| 105 | -***Note:** The [[PostLogin()|/FAQ/PostLogin]] method needs to be called manually at the end of your authentication process after user credentials are added to the session.* |
|
| 106 | - |
|
| 107 | -``` c# |
|
| 108 | -// Call the Izenda PostLogin() from your login page after authentication is complete |
|
| 109 | -Izenda.AdHoc.AdHocSettings.AdHocConfig.PostLogin(); |
|
| 110 | -``` |
|
| 111 | - |
|
| 112 | -*Once security is fully configured, add the following code to the [[ConfigureSettings()|/FAQ/ConfigureSettings]] method to prevent users from navigating to reports without logging in first.* |
|
| 113 | - |
|
| 114 | -``` c# |
|
| 115 | -// Require Login once security is configured. |
|
| 116 | -AdHocSettings.RequireLogin = true; |
|
| 117 | -AdHocSettings.LoginUrl = "INSERT_YOUR_LOGIN_PAGE_HERE"; |
|
| 118 | 104 | ``` |
| ... | ... | \ No newline at end of file |