Usage
Create a MitID transaction with provider: dkMitID and method: auth. Set action to describe what the user is doing: LogOn for login, Sign for signing, or Approve / Confirm / Accept for approvals. The text in referenceText is shown to the user.
The separate sign method is deprecated. Use auth with action: Sign.
MitID is a redirect or embedded flow: the response gives you a URL to send the user to, or initialisation data to embed MitID's own UI client. You can set the interface language (Danish, English or Greenlandic) and the minimum level of assurance (Low, Substantial or High, default Substantial).
On completion you get back a stable user ID, the registered name, date of birth and the identity assurance level.
Personal and business (Erhverv)
By default the user logs in with their personal MitID. To use MitID Erhverv, enable business login on the request. The user then authenticates as a representative of their organisation, and the completion data includes the organisation name and CVR, along with details such as the production unit (P-number), SE number and work email. A CPR can't be pre-set for business login.
Returning to a known user
If you've seen a user before, pass the user ID from their previous transaction to skip MitID's account-selection page next time (MitID's reauth flow).
CPR
MitID doesn't return the Danish personal number (CPR) by default. You have three options:
- Pre-set a CPR to restrict the transaction to that one person. Not available for business login.
- Ask the user to enter their CPR as an extra step, so it's validated and returned in the completion data.
- After completion, check a CPR you already hold against the user without retrieving theirs, using the CPR-match endpoint, which returns a simple match or no-match.
The last two let you verify identity while keeping to data-minimisation principles.