System user flow for Altinn 3.
Ported from wenche/systembruker.py in the original Python Wenche project.
Altinn 3 requires that end-user systems register themselves in the system register and create a system user for each organization they will act on behalf of.
Required options
All public functions require a :name option — a short, lowercase identifier
for the system (e.g. "kontira"). This is used to build the system ID
(<vendor_orgnr>_<name>) and as the display name in Altinn.
registrer_system/4 additionally requires a :description option — a map
with "nb", "nn", and "en" keys describing the system.
Setup (run once)
registrer_system/4— registers the system in Altinn's system registeropprett_forespoersel/4— sends request to org for approval- User approves via confirmUrl in browser
For submission, use Wenche.Maskinporten.get_systemuser_token/2 to get a token.
Summary
Functions
Gets the status of a system user request.
Gets all approved system users for the system.
Creates a system user request for the organization.
Registers or updates the system in Altinn's system register.
Returns the list of resource IDs that the system requests access to.
Returns the raw rights structure used in Altinn API payloads.
Returns the system ID in the format <vendor_orgnr>_<name>.
Functions
Gets the status of a system user request.
Returns {:ok, response_map} or {:error, reason}.
Optional options
:env—"test"or"prod"(default:"prod")
Gets all approved system users for the system.
Returns {:ok, [system_user_map]} or {:error, reason}.
Required options
:name— short lowercase system identifier (e.g."kontira")
Optional options
:env—"test"or"prod"(default:"prod")
Creates a system user request for the organization.
Returns {:ok, %{id: uuid, status: "New", confirmUrl: url}} or {:error, reason}.
The user must go to confirmUrl and approve in the browser.
Required options
:name— short lowercase system identifier (e.g."kontira")
Optional options
:env—"test"or"prod"(default:"prod")
Registers or updates the system in Altinn's system register.
Tries POST first. If the system already exists, uses PUT to update.
Required options
:name— short lowercase system identifier (e.g."kontira"):description— map with"nb","nn","en"keys
Optional options
:env—"test"or"prod"(default:"prod")
Returns {:ok, response_map} or {:error, reason}.
Returns the list of resource IDs that the system requests access to.
Each entry is a short resource value string, e.g. "app_brg_aarsregnskap-vanlig-202406".
Returns the raw rights structure used in Altinn API payloads.
Returns the system ID in the format <vendor_orgnr>_<name>.