Connect to Context Handler / FKA with SAML 2.0 (Template)
Connect FoxIDs to Context Handler with the Context Handler / FKA SAML 2.0 authentication method template. The template configures OIOSAML 3 for the Context Handler test or production environment.
Context Handler is the Danish identity broker for municipal federation, called Fælleskommunal Adgangsstyring (FKA).
Combine the authentication method with an OpenID Connect application registration to let FoxIDs bridge SAML 2.0 to OpenID Connect. Applications select the Context Handler authentication method and receive the configured claims.
In the Context Handler test environment, you can sign in with the FoxIDs test IdP or through other test municipalities. You can also configure your own FoxIDs test Identity Provider using a manually configured SAML application registration.

You can try Context Handler with the online web app sample by selecting Log in and Danish Context Handler TEST or Danish Context Handler. In test, select FoxIDs - test-corp on the Context Handler login page. Explore the configuration in FoxIDs Control: test-corp. The reader email address and password are shown on the sign-in page. Select the
context-handler,context-handler-testorcontext-handler-idp-testenvironment.
Separate environments
Use separate FoxIDs environments for Context Handler test and production. Each connection needs its own production OCES3 certificate, including the test connection. Follow KOMBIT's certificate guidance and use a unique certificate for each registered system and environment.
The certificate belongs to the entire FoxIDs environment. Uploading a certificate through the template changes the environment's signing certificate and can affect other connections. Connect the dedicated environments to your application environment with Environment Links.
To create an environment, open the Environments selector in FoxIDs Control Client, click New environment, enter a name and click Create.
A test Identity Provider for Context Handler also belongs in its own environment with a unique production OCES3 certificate.
Create the Context Handler authentication method
Select the dedicated FoxIDs environment and open Authentication.
Click New authentication and select Connect to Context Handler / FKA.

Enter a name, for example
Context Handler test.Select Context Handler environment: Test or Production.

Both test and production require a production OCES3 certificate with its private key, available through the certificate administration. The template reuses a matching certificate from the environment. Otherwise, upload your certificate (
.p12), enter its password and click Read and use certificate.Select Change certificate to choose another certificate. A certificate type warning indicates that a production OCES3 certificate is expected; you can still save the uploaded certificate. Expired certificates are shown in red and require a valid replacement. The selected certificate is applied when you click Create or Update.
To manage the certificate on the environment's Certificates tab instead, enable Show advanced and disable Update the environment certificate.

Review the attributes and privileges and enter the name of your own service in Service name in metadata. This required name is included in the SP metadata shared with Context Handler.
Add an administrative contact person, including company and email address.

Click Create.
The selected environment supplies the IdP metadata URL:
| Context Handler environment | IdP metadata |
|---|---|
| Test | Test metadata |
| Production | Production metadata |
FoxIDs uses automatic metadata updates with a 24-hour update interval, including updates to Context Handler's signing certificates. The URLs are published in KOMBIT's Context Handler documentation.
Attributes and privileges
The template requests and forwards these attributes:
https://data.gov.dk/model/core/specVersionhttps://data.gov.dk/concept/core/nsis/loadk:gov:saml:attribute:AssuranceLevelhttps://data.gov.dk/model/core/eid/professional/uuid/persistenthttps://data.gov.dk/model/core/eid/professional/cvrhttps://data.gov.dk/model/core/eid/professional/orgNamehttps://data.gov.dk/model/core/eid/emailhttps://data.gov.dk/model/core/eid/firstNamehttps://data.gov.dk/model/core/eid/lastNamehttps://data.gov.dk/model/core/eid/privilegesIntermediate
See the Context Handler OIOSAML 3 attribute profile for details about the supported attributes.
Request CPR attribute is available under Show advanced and disabled by default. Enable it to request and forward https://data.gov.dk/model/core/eid/cprNumber when your application needs it. The attributes actually returned depend on the Context Handler connection and upstream identity provider.
DK XML privilege to JSON is enabled by default. It converts the received privilege XML into readable JSON using the DK privilege transformation. Disable it to forward the original privilege claim. This does not change the roles assigned in Context Handler.
FoxIDs maps SAML claims to JWT claims for OpenID Connect applications. Configure the application's issued claims to include the required mapped claims; see claims. For example, the privilege claim is mapped to privileges_intermediate.
Register the user system in Context Handler
- Open the Context Handler administration portal for test or production.
- Select IT-systems (IT-systemer) and Add IT-system (Tilslut it-system).
- Fill in the system details and select User system (Brugervendt system).
- On the User system tab, select SAML 2.0.
- Select the OIOSAML3 profile, the required NSIS level and, optionally, a NIST assurance level.
- In FoxIDs, copy the SAML 2.0 method URL from Application information at the top of the saved template.
- Register this URL as the NSIS SAML metadata URL in Context Handler. Use the URL so metadata and certificate changes can be retrieved automatically. The template also offers a metadata download.
- Complete the remaining fields, accept the terms and save.
See KOMBIT's administration guide for the metadata URL and certificate replacement workflow.
Try the connection
Open the saved authentication method and select Test authentication, then Start the test. In the Context Handler test environment, select the FoxIDs test IdP or another test municipality and sign in with a test user. A successful login returns to the test application with the received claims. You can also try logout and inspect the returned privilege JSON.
Standard SAML configuration
Select Switch to standard SAML settings on a saved authentication method to edit the full SAML configuration. This stops the template's automatic certificate updates. Switching back reapplies its defaults and keeps the saved certificate-update choice.
For the manual configuration steps, see Context Handler / FKA (Legacy standard configuration).
Configuring test Identity Provider for Context Handler
Configuring your own test Identity Provider is optional. You can also sign in through other test municipalities available in the Context Handler test environment.
To configure FoxIDs as your own test Identity Provider, add Context Handler as a SAML 2.0 relying party as described below.
Use a separate environment for your test users. On its Certificates tab, select Contained certificates, upload your unique production OCES3 certificate as the primary certificate and enter its password.
1 - Start by creating a SAML 2.0 application registration in FoxIDs Control Client
Select the Applications tab
Click New application
Select Show advanced
Select Web Application (SAML 2.0)
Add the Name e.g.,
Context Handler IdPDownload the Context Handler RP metadata where you can find endpoints and the certificate to trust.
Test metadata:https://n2adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2auth/metadata.idp?samlprofile=nemlogin3
The certificate is base64 encoded and can be converted into a certificate file.cerwith the FoxIDs certificate tool.Add the Application issuer
https://saml.n2adgangsstyring.eksterntest-stoettesystemerne.dk/runtimeand the metadataAdd the Assertion consumer service (ACS) URL
https://n2adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2auth/consume.idpfrom the metadata
Click Register
Read the Metadata URL and save it for later
Click Close
The detailed configuration opens, select Show advanced in the top right corner of this configuration section
Enable Absolute ACS URL
Set Encrypt authn response to Yes
Add the encryption certificate from the metadata in Encryption certificate
Set the NameID format to
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectNameAdd the Logged out URL
https://n2adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2auth/signoffresponse.idpfrom the metadataAdd the Single logout out URL
https://n2adgangsstyring.eksterntest-stoettesystemerne.dk/runtime/saml2auth/signoffrequest.idpfrom the metadataSet the Logout request binding and the Logout response binding to redirect
Set the OIOSAML3 claims which should be issued to Context Handler in Issue claims
The following claims are most often used:
https://data.gov.dk/model/core/specVersionhttps://data.gov.dk/model/core/kombitSpecVerhttps://data.gov.dk/concept/core/nsis/loahttps://data.gov.dk/model/core/eid/professional/cvrhttps://data.gov.dk/model/core/eid/privilegesIntermediate
- Add the signing certificate from the metadata in Signature validation certificate
- Optionally set the Certificate validation mode to Chain trust if the OCES3 root certificate is trusted on your platform Set the Certificate revocation mode to Online
- Set Authn response sign type to Sign assertion
- Configure a Custom IdP issuer, the issuer can optionally start with
https://saml.The issuer in this examplehttps://saml.foxids.com/test-corp/context-handler-test-idp/ - Select Yes in Add logout response location URL in metadata
- Select Yes in Include the encryption certificate in metadata
- In Contact persons in metadata, click Add contact person and click Administrative to add an administrative contact person

- Click Update
- Go to the top of the SAML 2.0 application section
- Find the test IdP-metadata in SAML 2.0 Metadata, in this case
https://foxids.com/test-corp/context-handler-idp-test/ch-idp(*)/saml/idpmetadata
The test IdP-metadata is used to configure the Context Handler identity provider.
2 - Then go to the Context Handler administration portal in Test
- Select IT-systems (DK: IT-systemer)
- Click Add IT-system (DK: Tilslut it-system)
- Fill out the fields and select Identity Provider
- Go to the Identity Provider tab
- Select Context Handler with NSIS and remove the selection of Context Handler (without NSIS)
- Select OIOSAML3 as OIOSAML profile and NSIS level
- Add the test IdP-metadata URL, in this case
https://foxids.com/test-corp/context-handler-idp-test/ch-idp(*)/saml/idpmetadata. - Fill out the rest, accept the terms and click Save (DK: Gem)
You are required to be registered as your own test authority (DK: egen test myndighed) in the test environment to add a federation agreement. A federation agreement (DK: føderationsaftaler) is required to enable the identity provider in Context Handler.
3 - Add claim transformation in FoxIDs Control Client
Create the claims to issue to Context Handler using claim transforms.
- Go back to the SAML 2.0 application
Context Handler IdP - Select the Claim transforms tab
- Add a Constant claim
https://data.gov.dk/model/core/specVersionwith the valueOIO-SAML-3.0 - Add a Constant claim
https://data.gov.dk/model/core/kombitSpecVerwith the value2.0 - Add a Constant level of assurance (loa) claim
https://data.gov.dk/concept/core/nsis/loawith e.g. the valueSubstantialor read the claim through the claims pipeline

- Add a Concatenated claim to replace the NameID
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifierwith a concatenated version of the CVR number, display name and unique user ID - Select Action Replace claim
- Concatenate claims:
https://data.gov.dk/model/core/eid/professional/cvrhttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/givennamehttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/surnamehttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
- Set the Concatenate format string to
C=DK,O={0},CN={1} {2},Serial={3}
- Click Update
4 - Add SAML 2.0 claim to JWT claim mappings in FoxIDs Control Client
FoxIDs internally converts SAML 2.0 claims to JWT claims. Context Handler uses an OIOSAML3 defined set of SAML 2.0 claims where corresponding JWT mappings need to be added in the environment.
- Go to Settings tab and Claim mappings
- Click Add claim mapping for all the claims configured in step 1.20, you can create your own short JWT claim names if no standard name exists (or edit the claim mappings if they already exist)
- Click Update
5 - Add test users in FoxIDs Control Client
Add test users with test claims on the Users tab under Internal Users.
Test claims on test users are JWT based and mapped to SAML 2.0 claims.
Each test user is required to have a CVR cvr claim, given name given_name claim, family name family_name claim and optionally a privilege claim with a base64 encoded DK privilege XML string value.

If the user should have the Job function role (DK: Jobfunktionsrolle) http://foxids.com/roles/jobrole/test-corp-admin_access/1 the DK privilege XML would be (with test CVR number: 11111111):
<?xml version="1.0" encoding="UTF-8"?>
<bpp:PrivilegeList xmlns:bpp="http://digst.dk/oiosaml/basic_privilege_profile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<PrivilegeGroup Scope="urn:dk:gov:saml:cvrNumberIdentifier:11111111">
<Privilege>http://foxids.com/roles/jobrole/test-corp-admin_access/1</Privilege>
</PrivilegeGroup>
</bpp:PrivilegeList>