iVendNextDevelopers My apps

A standalone portal with "Sign in with iVendNext" — the recipe

This recipe builds a web app of your own, on your own server, for people who already have accounts in a retailer's iVendNext: a head-office view, a franchise portal, a manager's dashboard. The person signs in with their iVendNext account, and the portal shows only what that person's own permissions allow.

Next: the sample, S13 · A standalone portal with "Sign in with iVendNext"All recipes

A retailer user signs in to a portal, allows it, sees their store's sales; a user with no right is told so

Reference implementation: samples/s13_portal/ (the portal, its tests).

When to use it. When the screen cannot live inside the retailer's iVendNext. If it can, use iVendNext's own screens first (guide/03_ladder_and_never_list.md, rungs 1–4); a portal is rung 5.

Steps

  1. Ask iVendNext to register your app (recipes/sign_in.md §1): an OAuth Client with your exact redirect address (https://your.server/callback), scopes openid all. They give you the client id and the client secret: keep the secret on your server, never in a page. To let only some roles into your app, they list them under Allowed Roles: iVendNext then stops anyone else at its own Allow step.

  2. Run the portal with four settings:

    PORTAL_SHOP=https://shop.example PORTAL_CLIENT_ID=… PORTAL_CLIENT_SECRET=… PORTAL_REDIRECT=https://your.server/callback python3 portal.py

    The secret goes only to iVendNext, with the code exchange and the sign-out. iVendNext does not check it on this build (recipes/sign_in.md §4), but send it: a portal without it stops signing anyone in the day iVendNext starts checking.

    Put it behind HTTPS and set PORTAL_SECURE=1, so the session cookie is never sent in the clear. Over HTTPS the portal names its session cookie __Host-… (Secure, Path=/, no Domain), so a neighbouring ⟨app⟩.ivendnext.app cannot set or overwrite it: S13 does this wherever it runs, hosted with us included.

    What a person sees: the portal's button the portal's sign-in page leads to the retailer's own sign-in and then its Allow page, which names your app the Allow page. The portal never sees the password.

  3. Give each person the permissions you want them to have — in the retailer's iVendNext. The portal does no filtering of its own. A store user is fenced to their store by a User Permission on the store (the same way S8 and S14 do); the portal's list then holds only that store's sales. Change who sees what in the retailer's iVendNext and the portal follows.

  4. Make your own pages with the kit. The sample's pages carry the kit's classes only, no colour or font of your own. Run the screen check on every page you ship: kit/design/tools/check_kit.sh your-page.html.

    The same portal with a store user the sales list, a link into the retailer's Desk the record behind a link, and a user with no right not allowed.

  5. Decide what to list. The sample lists the latest 20 sales (POS Invoice) with a link into the retailer's Desk record. Replace it with the records your people need; ask only for the fields you show.

What is refused, and why

Your duties

Technical notes

What was proven, and where

Measured

Not proven

The token's lifetime (an hour, read from the retailer's code; the ended token's path is proven on the laptop only); a person disabled while signed in; the refresh token; HTTPS (the bench is plain HTTP on its own network); two portals on one client; many users at once; a person's browser was played by a script (the pages were checked by the screen check, not looked at by a person).

This page in the kit