Skip to content

How Save2ERP works ​

Save2ERP has two parts:

  • a Word add-in, which shows the Save2ERP pane in Word for Windows, Mac or the web;
  • a Save2ERP server, installed by your company (or hosted for it). It serves the pane's pages, handles user sign-in to the target system and forwards documents to it.

The target system is the business system (ERP) where documents are saved, for example SAP.

Architecture ​

┌────────────────┐       ┌──────────────────┐       ┌──────────────────┐
│ Word           │ HTTPS │ Save2ERP server  │ HTTPS │ Target system    │
│ Save2ERP       │ ────► │ pages, OAuth2,   │ ────► │ OAuth2 server    │
│ pane           │       │ relay to the API │       │ REST API         │
└────────────────┘       └──────────────────┘       └──────────────────┘
  • The pane never contacts the target system directly: all requests go through the Save2ERP server. The /test page follows the same path, from a browser.
  • Sign-in to the target system uses OAuth2 with PKCE. The token stays on the server, encrypted in a cookie the browser cannot read (see Security and data).
  • With a license limited by number of users, the pane obtains the user's Microsoft identity to count them (see Installing and renewing the license).

The system is set by the document ​

The Word document generated by the target system contains custom properties that the user does not see, including S2E_SystemKey, which identifies the system (for example P01CLNT100). The user therefore never chooses the system: the document sets it (see Preparing Word documents).

The server only accepts the systems declared in its configuration (see Configuring the server). During a session, it locks the system: a document from another system shows "System change detected" until the user signs out. A test document can thus never be sent to production by mistake with the same session.

How a document is sent ​

  1. The user opens the pane. The server checks its license and, with a limited license, the user.
  2. The pane reads the document's system and requests the save page from the server.
  3. Without a valid session, the pane shows the sign-in page: a window opens on the target system's OAuth2 server, the user signs in and authorizes Word. The server receives the token and keeps it, encrypted, in a cookie.
  4. The user clicks the save button. Through the server, the pane asks the target system whether a file with the same name already exists, and reads the document in Word at the same time.
  5. The pane sends the document to the server, which forwards it to the target system with the token. The result is shown in the pane.

The server renews the token automatically before it expires. If the target system refuses the renewal, the user must sign in again. If it does not respond, the session is kept and the user can try again later.

Two modes ​

ModeAddressUse
Officeopened from the Word ribbonNormal use: sending the document.
Test pagehttps://<server>/test, in a browserDiagnostics, without Word: check the OAuth2 sign-in and the target system's API (see Troubleshooting).

The test page remains available without a valid license, so that an installation can be diagnosed.