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
- Register a user with Mijn Aansluiting here: https://www.acc.mijnenergiedata.nl/toestemmingen/welkom
- Get the client-id and client-secret
- Generate a JKS key pair and register your public key with Mijn Aansluiting.
- Request an API token for the EAN codeboek API, this can be done here.
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 values | Description |
|---|---|
region-connector.nl.mijn.aansluiting.issuer-url | The 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-url | The 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-id | The Client-ID needed to facilitate the OAuth flow. Must be the Client-ID for the continuous API. |
region-connector.nl.mijn.aansluiting.continuous-scope | The 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-id | The ID of the key for Mijn Aansluiting continuous API. |
region-connector.nl.mijn.aansluiting.codeboek-api | The 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-token | The API token for the codeboek API, which was previously requested here. |
region-connector.nl.mijn-aansluting.polling | Used 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.location | Path 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.password | Password to access the keystore. |
spring.ssl.bundle.jks.nl.key.alias | The alias under which the key is saved in the keystore. |
spring.ssl.bundle.jks.nl.key.password | Password to access the key in the keystore |
spring.ssl.bundle.jks.nl.keystore.type | The 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
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=passwordregion-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: passwordREGION_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=passwordRunning 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: