Skip to content

Region Connector for the Netherlands (Mijn Aansluiting)

This README will guide you through the process of configuring a region connector for the permission administrators in the Netherlands. Mijn Aansluiting permission process is based on an OAuth 2.0 Authorization Code Grant with the PKCE extension. See OAuth 2.0 and Key Proof for more information. This region connector uses an event sourcing approach to create permission requests with the permission administrator. It emits the following information:

  • Consent Market Documents for changes in statuses for permission requests
  • Connection Status Messages for changes in statuses of permission requests
  • Validated Historical Data Market Documents for consumption, production energy data and gas data. IMPORTANT: All data will be missing the first value of the requested period, because it is needed to calculate the deltas between the total daily meter readings.

Mijn Aansluiting only supports daily measurements for a maximum of two years in the past, but unlimited time in the future.

For the OAuth 2.0 flow a private key is required, that has to be made available via a Java Key Store. The configuration parameters can be seen in section Configuration of the Region Connector To create a Java Key Store see this tutorial. The private key must use the RS256 key algorithm.

For the available test users see the test user documentation. To test use the test users with the correct metering point for specific data. For data needs for electricity data pick the test users whose EAN starts with ELK, for gas the EAN needs to start with GAS.

Prerequisites

Configuration of the Region Connector

The region connector needs a set of configuration values to be able to function correctly, how you provide these values depends on the way you deploy the region connector.

Configuration valuesDescription
region-connector.nl.mijn.aansluiting.issuer-urlThe Issuer Url of the authorization server. You can get this information from the portal where you registered the user.
region-connector.nl.mijn.aansluiting.redirect-urlThe redirect URL that will be used by the authorization server to redirect the final customer to. Should be domain + /nl-mijn-aansluiting/oauth2/code/mijn-aansluiting
region-connector.nl.mijn.aansluiting.continuous-client-idThe Client-ID needed to facilitate the OAuth flow. Must be the Client-ID for the continuous API.
region-connector.nl.mijn.aansluiting.continuous-scopeThe scope of the energy data that is requested, 24_maanden_dagstanden allows to access up to two year old energy data.
region-connector.nl.mijn.aansluiting.continuous-key-idThe ID of the key for Mijn Aansluiting continuous API.
region-connector.nl.mijn.aansluiting.codeboek-apiThe API endpoint of the codeboek API. Should always be https://gateway.edsn.nl/eancodeboek/v1/ecbinfoset. For information see the docs
region-connector.nl.mijn.aansluiting.codeboek-api-tokenThe API token for the codeboek API, which was previously requested here.
region-connector.nl.mijn-aansluting.pollingUsed to configure when future data should be polled, uses Spring cron syntax. The default is 17 o'clock every day.
spring.ssl.bundle.jks.nl.keystore.locationPath to the keystore, which contains the private key needed to create OAuth Requests. It is recommended to create a keystore for each key to simplify key rotation and updates.
spring.ssl.bundle.jks.nl.keystore.passwordPassword to access the keystore.
spring.ssl.bundle.jks.nl.key.aliasThe alias under which the key is saved in the keystore.
spring.ssl.bundle.jks.nl.key.passwordPassword to access the key in the keystore
spring.ssl.bundle.jks.nl.keystore.typeThe keystore type. Should always be set to JKS

The region connector can be configured using Spring properties or environment variables. When using environment variables, the configuration values need to be converted in the following way:

  • Replace all non-alphanumeric characters with an underscore (_)
  • Optionally convert all letters to upper case
properties
region-connector.nl.mijn.aansluiting.issuer-url=https://www.acc.mijnenergiedata.nl/autorisatieregister
region-connector.nl.mijn.aansluiting.redirect-url=https://example.com/callback
# Continuous API
region-connector.nl.mijn.aansluiting.continuous-client-id=client-id
region-connector.nl.mijn.aansluiting.continuous-scope=24_maanden_dagstanden
region-connector.nl.mijn.aansluiting.continuous-key-id=key-id
# Codeboek API
region-connector.nl.mijn.aansluiting.codeboek-api=https://gateway.edsn.nl/eancodeboek/v1/ecbinfoset
region-connector.nl.mijn.aansluiting.codeboek-api-token=replace-me

region-connector.nl.mijn.aansluiting.polling=0 0 17 * * *

# Key Store Config
spring.ssl.bundle.jks.nl.keystore.location=./mijn-aansluiting.jks
spring.ssl.bundle.jks.nl.keystore.password=password
spring.ssl.bundle.jks.nl.keystore.type=JKS
spring.ssl.bundle.jks.nl.key.alias=mijn-aansluiting
spring.ssl.bundle.jks.nl.key.password=password
yaml
region-connector:
  nl:
    mijn:
      aansluiting:
        issuer-url: https://www.acc.mijnenergiedata.nl/autorisatieregister
        redirect-url: https://example.com/callback
        continuous-client-id: client-id
        continuous-scope: 24_maanden_dagstanden
        continuous-key-id: key-id
        codeboek-api: https://gateway.edsn.nl/eancodeboek/v1/ecbinfoset
        codeboek-api-token: replace-me
        polling: 0 0 17 * * *
# Continuous API
# Codeboek API


# Key Store Config
spring:
  ssl:
    bundle:
      jks:
        nl:
          keystore:
            location: ./mijn-aansluiting.jks
            password: password
            type: JKS
          key:
            alias: mijn-aansluiting
            password: password
dotenv
REGION_CONNECTOR_NL_MIJN_AANSLUITING_ISSUER_URL=https://www.acc.mijnenergiedata.nl/autorisatieregister
REGION_CONNECTOR_NL_MIJN_AANSLUITING_REDIRECT_URL=https://example.com/callback
# Continuous API
REGION_CONNECTOR_NL_MIJN_AANSLUITING_CONTINUOUS_CLIENT_ID=client-id
REGION_CONNECTOR_NL_MIJN_AANSLUITING_CONTINUOUS_SCOPE=24_maanden_dagstanden
REGION_CONNECTOR_NL_MIJN_AANSLUITING_CONTINUOUS_KEY_ID=key-id
# Codeboek API
REGION_CONNECTOR_NL_MIJN_AANSLUITING_CODEBOEK_API=https://gateway.edsn.nl/eancodeboek/v1/ecbinfoset
REGION_CONNECTOR_NL_MIJN_AANSLUITING_CODEBOEK_API_TOKEN=replace-me

REGION_CONNECTOR_NL_MIJN_AANSLUITING_POLLING=0 0 17 * * *

# Key Store Config
SPRING_SSL_BUNDLE_JKS_NL_KEYSTORE_LOCATION=./mijn-aansluiting.jks
SPRING_SSL_BUNDLE_JKS_NL_KEYSTORE_PASSWORD=password
SPRING_SSL_BUNDLE_JKS_NL_KEYSTORE_TYPE=JKS
SPRING_SSL_BUNDLE_JKS_NL_KEY_ALIAS=mijn-aansluiting
SPRING_SSL_BUNDLE_JKS_NL_KEY_PASSWORD=password

Running the Region Connector via EDDIE

If you are using EDDIE, the region connector should appear in the list of available region connectors if it has been configured correctly.

Documentation

Some important documentation links: