Authentication
This section describes how to authenticate towards the DGM API.
Before you can start using the API, you need to have either of the following:
- An access code issued to you by us (for test environment only)
- A JWT access token from Maskinporten with the correct scopes
Access code (for test environment only)
Warning
This approach is intended for quick starting and testing purposes only. It allows for a parallel process of setting up maskinporten and still integrating with DGM. It is not possible to use this approach in the production environment. We therefore recommend using the maskinporten access token approach as soon as possible.
To get an access code, you need to contact us to receive a secret. You'll need to provide us with a organization number and whether you're building a system for a funeral home or graveyard authority. When you do have this acccess code, you'll be able to use it as a query parameter in the API requests.
Example:
POST /dgm/api/funeral-home/lookup?accessCode=my-access-code
Maskinporten JWT access token
This is the intended approach for both production and test environments.
Info
This section is about access to the API itself. It doesn't cover authorization for specific operations on funerals, and access to certain funerals. This is covered in the authorization section.
If your organization have not used Maskinporten before, you'll need to get access to maskinporten firstly. You can do this by following the instructions here.
When this is done, we will need to give you access to the scopes you need. Please reach out to us to get this set up. For this we will need to know the organization number that your organization has in Maskinporten.
There are currently two scopes available: dgm:graveyardauthority
and dgm:funeralhome
.
Depending on whether you operate on behalf of a graveyard authority or a funeral home, you will be granted access to the corresponding scope.
When we have granted your organization access to the correct scope, you can follow the guide here to generate a JWT access token.
There exists client libraries for Maskinporten. For instance, Altinn has a .NET library available here.