Last modified: Apr 23, 2026

Impersonating users

How to impersonate a user in the service owner API for read operations

Select environment: Help
This dropdown lets you select which Dialogporten environment the content of this page should be based on. If unsure, use the default "Staging (TT02)", as this is the environment you would normally test against when integrating Dialogporten.

For bleeding edge, select "Dev", as this contains the most recent unreleased changes to the Dialogporten API. Select "Local dev" if you want to test changes to Dialogporten itself running locally.

Introduction

Service owners might want to offer custom views for Dialogporten data in their own portals. While it is possible for a service owner to authenticate as an end-user system, this has both usability and GDPR drawbacks, as it 1) requires the user to handle a consent dialog in ID-porten to grant the system access, and 2) grants the service owner access to user dialogs belonging to other service owners.

To alleviate this, Dialogporten offers a way to use the existing service-owner authentication while additionally supplying an end-user ID to further filter the available dialogs. This results in a list of dialogs created by the service owner that the end user has access to, eliminating the need for ID-porten consent and avoiding the service owner getting access to any other dialogs the user might have access to.

Basic steps

  1. Authenticate against Dialogporten as a service owner system
  2. Authenticate the end-user in the service owner portal (via ID-porten or other means)
  3. Construct an end-user ID, typically urn:altinn:person:identifier-no:<11 digit Norwegian identifier number>
  4. Perform a call to /api/v1/serviceowner/dialogs/?endUserId=urn:altinn:person:identifier-no:<11 digit norwegian identifier number>&Party=...&ServiceResource=...&<other filter parameters>

Searching for dialogs

Note that when impersonating users, the restrictions for the end-user API also apply here, notably that serviceResource and/or party must be supplied.

Returned information

See the dialog search DTO for full details.

Getting dialog details

Returned information

See the dialog details DTO for service owners for full details.