====== N4V Dashboard Builder ====== This page covers what to do **the first time** (N4V 2026.4+), once the webapp is deployed: turn security on, create the first account, set the permissions, then test the whole thing. Allow about twenty minutes, including two trips to the server. Throughout this page, ''SERVER'' stands for your server's name, ''WEBAPP'' for a webapp name (''N4VDashboardBuilder'', for instance) and ''TOMCAT'' for Tomcat's installation directory. As long as nothing is configured, the builder behaves **exactly as before**: no check, no session, not a single log line. Turning security on is a deliberate act — which is what makes it safe to install this version on an existing site without changing anything for it. **The one principle to remember**: everything this component reads and writes lives **inside the webapp**, under ''WEB-INF/''. Nothing is written to ''tomcat/conf'', or anywhere else on the server. The webapp backs up, restores and moves as one piece. ===== Before you start ===== ==== Requirements ==== * **Tomcat 7 to 9** (including the one shipped with SAP BusinessObjects), Java 8 or later. * The ''N4VDashboardBuilder'' webapp deployed and reachable. * The ''n4v.lic'' licence file at the webapp root. * **Filesystem access to the server** for two reads: the bootstrap token and, should anything go wrong, the Tomcat log. ==== The files, and what they are for ==== ^ File ^ Purpose ^ | ''WEB-INF/n4v_guard.conf'' | The configuration. **Re-read on the fly**, no restart. | | ''WEB-INF/n4v_users.json'' | The built-in directory, if you use it. Hashed passwords (PBKDF2-HMAC-SHA256, 210,000 iterations). | | ''WEB-INF/n4v_bootstrap.token'' | The bootstrap token, to be read once. | | ''WEB-INF/n4v_guard.log'' | The access log, if you enable it. | | ''WEB-INF/n4v_acl.json'' | The "who sees what" rules, written by the builder at publish time. | | ''WEB-INF/lib/n4v-guard.jar'' | The filter itself. Replacing it requires reloading the webapp. | The configuration is picked up within seconds. The **JAR, however, is not re-read on the fly**: after replacing it, run ''touch WEB-INF/web.xml'' — Tomcat reloads that webapp, and only that one. No need to restart the server. ===== Step 1 — Check that the builder answers ===== Open ''https://SERVER/N4VDashboardBuilder/''. The application must load, and you must see an orange **"Unsecured access"** button at the top left, next to the logo. That button is deliberate: a security gap nobody sees is a security gap nobody fixes. It is also **the entry point for the whole setup** — keep it handy. * If the page reads "License key missing or invalid", see [[#troubleshooting|Troubleshooting]]. * If the button does not appear even though you configured nothing, your hosting may not serve JSPs; server publishing and the administration screen will not work either. ===== Step 2 — Fetch the bootstrap token ===== On the server, read: TOMCAT/webapps/N4VDashboardBuilder/WEB-INF/n4v_bootstrap.token The same token is written to the Tomcat log at startup (''catalina.out''), between two banner lines that are easy to spot. **Why a token.** As long as security is off, anyone could open the administration screen and take control of it. The screen therefore asks for proof that you have access to the server — the only proof worth anything at that point. Once security is on, a signed-in administrator no longer needs it. ===== Step 3 — Turn security on ===== Click **"Unsecured access"**: the administration screen opens. Paste the token when asked. ==== Pick the mode ==== ^ Mode ^ What it protects ^ | ''off'' | Nothing. This is the default, and a complete pass-through. | | ''builder'' | The builder and every write endpoint. **Start here.** | | ''all'' | The same, **plus published webapps** (each needs the JAR — see step 6). | ==== Pick the directory ==== ^ Your situation ^ Directory ^ | A handful of people, no corporate directory to plug in | ''local'' | | Your users are already in the BusinessObjects CMS | ''bo'' | | A corporate portal already authenticates in front of Tomcat | ''header'' | | A modern identity provider (Entra ID, Keycloak, Okta, Ping) | ''oidc'' | | An **on-premise** Active Directory, or an OpenLDAP | ''ldap'' | **For a first run, choose ''local''.** Plug the corporate directory in afterwards, once everything else works: a setup you debug on two fronts at once does not get debugged. ==== Test, then save ==== The **Test** button writes nothing. It judges the values you typed with the very function that will write them, names **key by key** the ones it refuses, and asks the server what no documentation can answer for it: the OIDC redirect URI as computed from the request, the immediate peer address for ''header'', whether the SDK loads for ''bo'', whether the domain controller is reachable for ''ldap''. Then **Save**. Three guarantees worth knowing: * the screen **only rewrites the keys it manages**: comments, formatting and hand-written lines are preserved byte for byte; * an empty field **removes its line**; a connector block you did not select sends nothing; * **a secret never travels back** from the server. The field is empty every time you open the screen, and leaving it empty changes nothing. To genuinely remove a secret, tick //Clear this secret//. ===== Step 4 — Create the first administrator account ===== Reload the page. Security being on and the directory empty, the guard shows a **bootstrap page**: it asks for the token again, then has you create the first account. * Password: **12 characters minimum**, everywhere, no exception. * Five failures within fifteen minutes, for the same (login, address) pair, block further attempts. Sign in. An **account chip** appears at the top right: your initial, and on click the display name, the login, the groups, plus //Administration//, //Manage accounts// and //Sign out//. The "Unsecured access" button is gone — that is your confirmation that the component is live. ===== Step 5 — Accounts and permissions ===== Account chip → **Manage accounts**. ==== The roles ==== ^ Role ^ What it allows ^ | //(none)// | Viewing dashboards and portals, subject to the rules you set. | | ''n4v-author'' | Also: saving dashboards, portals and templates **on the server**. | | ''n4v-publisher'' | Also: **publishing**, that is, writing into //another// webapp. | | ''n4v-admin'' | Also: managing accounts, reading the diagnostic screens, and seeing **every** tile unfiltered. | Publishing implies saving: whoever may drop a dashboard into another webapp may obviously save it in this one. Roles are **declared, never inferred** — being a domain administrator does not make you a builder administrator. ==== The groups ==== Groups decide which tiles are visible in published portals. They are typed in the account's form, separated by a **comma, a semicolon or a line break**; case is ignored when comparing. ==== Loading accounts in bulk ==== In //Manage accounts//: **Excel template** downloads the blank sheet, **Export** dumps the directory as it stands, **Import** reads an ''.xlsx'' or a ''.csv'' back. * Columns are matched **by their heading** (case and accents ignored, English and French), never by their position. * A **preview** states, row by row, what will be done — and why a rejected row is rejected — **before** anything is sent. * An import **never deletes and never disables anything**. The password column is exported empty, and empty means "unchanged": the exported file reloads as is without touching a single password. **Create a second account with NO role right away.** An administrator sees everything, by design — and that is testing pitfall number one: checking permissions with an administrator account filters nothing and makes it look as if nothing works. ===== Step 6 — Secure the published webapps ===== A locked builder with wide-open published dashboards is the wrong way round. In the **Publish dashboard** dialog, one row shows the target webapp's state and closes it with a single button. The row only appears when the builder's security is on and your account may publish. The button does three things in the target webapp: it copies ''n4v-guard.jar'' into its ''WEB-INF/lib'', writes a ''web.xml'' there declaring the filter, and an ''n4v_guard.conf'' in ''all'' mode. Writing the ''web.xml'' is enough for Tomcat to reload that webapp: nothing to restart. * A ''web.xml'' **that did not come from the builder is never replaced on a single click**: the button spells out what will happen and becomes "Replace anyway", with a timestamped backup taken first. * **Accounts are not copied.** The published webapp reads the builder's directory, named by its //name//: ''n4v.local.usersFrom = N4VDashboardBuilder''. Handy consequence: disabling an account in the builder closes the door everywhere, immediately. * **A session is valid for one webapp.** Tomcat's session cookie carries the context path; signing in to the builder does not sign you in to the published webapp. That is the price of the model, and it is what makes revocation immediate. * Every secured webapp carries **its own copy of the JAR**. Updating the builder does not update those copies: the publish dialog flags it and brings them up to date. //If some guard behaviour seems ignored in a published webapp, check this first.// ===== Step 7 — Who sees what ===== In the builder's Portal mode, every tile carries a **Visible to** field (groups), and the **Who sees what** table summarises the lot. The rules are written into the target webapp at publish time and enforced by the filter on every request: hiding a tile protects nothing, the refusal happens server-side. Four rules govern these permissions: * **a dashboard with no rule is visible to every signed-in account** — securing an existing installation must not close anything that was open; * an empty group list counts as no rule at all; * an administrator sees everything; * an unreadable or missing ACL locks nobody out. In a webapp that carries a **portal**, the permissions come from the portal editor, which **rebuilds them on every publish**. Order to follow: publish the dashboards → set the permissions in the portal → publish the portal. ===== Step 8 — Test the installation ===== Do not skip this step: it is what turns "it is configured" into "it works". - **The nominal path**: in a private window, open the builder. You must be redirected to the sign-in form, then **land back on the page you asked for** after authenticating. - **The permissions**: with the role-less second account, the server-save and publish buttons must be absent or refused — in the interface **and** on the server. - **Tile filtering**: set //Visible to// on one or two tiles, republish the portal, open it with the role-less account. Only those tiles must show, and a direct hit on a refused dashboard's URL must leave a ''refus.page'' line in the log. - **The emergency door**, before you need it: see the next section. **Switching accounts means clearing two things**: the credentials your browser remembered //and// the session cookie. Without the second one, the guard sees a valid session and does not even re-read the identity — you would be measuring the previous account. A private window does both; close **all** of them between two accounts, as they share the same session. Two browser profiles save you the dance. ===== The emergency door ===== **Do not skip this section.** With a remote directory, the form no longer targets the local accounts — including the bootstrap account, the only one that is guaranteed to exist. A directory that goes down would therefore lock everybody out, you included. The local directory stays reachable: https://SERVER/WEBAPP/n4v-login?annuaire=local * With ''bo'' and ''ldap'', the sign-in page also offers a **directory choice** — provided the connector is really active, the fallback is open, and at least one local account exists. * With ''header'' and ''oidc'', which cannot check a password, the form targets the local directory directly. * To require the remote directory and nothing else: ''n4v.local.fallback = false''. **Measure what you are closing**: nobody gets in without the remote directory any more, you included. **Recommendation**: keep the fallback open and at least one local administrator account, tested. If your policy forbids it, document the file-server unlocking procedure **before** going live, not after. ===== Troubleshooting ===== ^ Symptom ^ Where to look ^ | **The page opens without asking for anything** | The webapp is not secured. Check that ''WEB-INF/web.xml'' does name ''com.need4viz.guard.GuardFilter'' and that ''n4v_guard.conf'' carries a mode other than ''off''. The usual cause: a ''web.xml'' rewritten after securing. | | **"Unsecured access" shows although the file exists** | Either ''n4v.guard.mode'' is ''off'', or the JAR was just dropped in and the webapp has not been reloaded (''touch WEB-INF/web.xml''). The button's tooltip tells you which. | | **I created the file and nothing changed** | Windows trap: with extensions hidden, the file is really called ''n4v_guard.conf.txt''. | | **I can sign in but I have no permissions** | ''/n4v-guard/me'': empty ''groups'' means read-only; ''groups'' filled and ''roles'' empty means the role mapping is missing. And **sign in again**: roles are set on the session at sign-in time. | | **The remote directory is ignored and everyone lands in local** | The Tomcat log at startup: the fallback is **loud** and names the missing setting or the absent library. | | **"License key missing or invalid" after signing out** | Fixed in 3.40.0, and the cause is neither the key nor the guard: the page came back from the browser cache, and its request for ''n4v.lic'' got a refusal that was read as an absence. On an earlier version: clear the cache, or open ''WEBAPP/n4v-login'' directly. | | **Scanning the source folder returns no file** | If the folder lives in **another secured webapp**: your builder session is only valid for the builder — sign in to that webapp in another tab. Since 3.40.1 the scan result says so and offers the link. | | **The server lists the files but none of them loads** | The **case** of the webapp name: on Windows the disk ignores capitals, Tomcat's address does not. A webapp named ''POC_CNAV'' requested as ''/poc_cnav'' lists perfectly and never serves a thing. Since 3.43.0 the builder adopts the real spelling and says so. | | **A published portal does not enforce the permissions** | Its JAR is probably older than the builder's. The publish dialog flags it and brings it up to date. | ==== The diagnostic screens ==== Open to signed-in administrators, they answer where documentation cannot: ^ Address ^ What it tells you ^ | ''WEBAPP/n4v-guard/me'' | Who you are as far as the guard is concerned: login, groups, roles. | | ''WEBAPP/n4v-guard/provider'' | Which connector is **really** active, what it understood, what it saw fail — with no secrets. This is what exposes the most misleading case of all: a connector whose module is missing, silently falling back to the local directory. | | ''WEBAPP/n4v-guard/elements'' | For a published webapp: which elements the permissions cover, and **why** a given access is allowed. | ===== If the configuration disappears ===== The guard remembers the last active mode in ''WEB-INF/n4v_guard.state''. If the configuration is gone while that state says ''builder'' or ''all'', it **refuses everything** and shows the unlocking procedure, rather than silently reopening. A door that reopens with nobody noticing is the worst failure mode for this component: a blocked builder gets noticed and fixed; a reopened one does not. To start over without security: delete ''n4v_guard.state''. ===== What this component does not address ===== Said once, plainly, because a misunderstood protection is one protection less. * **Exfiltration by a legitimate user.** Whoever can see can copy, print, photograph. * **Network security and Tomcat hardening**, which remain yours — in particular whether Tomcat is reachable without going through your portal. * **Encryption at rest** of the webapp's files. * **An ACL that is closed by default**: a published dashboard with no rule is visible to every signed-in account. ===== Going further ===== * The detail of each directory (''bo'', ''header'', ''oidc'', ''ldap''), key by key, with the checks specific to each: the **N4V Guard — Authentication** documentation. * The builder's built-in help, section **13 — Access security** (the ''?'' button at the top right).