---
title: 'Between: 2024/03/01 en 2024/03/31 - 0110.be'
canonical: https://0110.be/date/2024/3
markdown_url: https://0110.be/date/2024/3.md
page: 0
posts_per_page: 30
total_posts: 2
filters:
  year: 2024
  month: 3
previous:
next:
---

# Between: 2024/03/01 en 2024/03/31 - 0110.be

## [Measuring rain water tank level with an Arduino](https://0110.be/posts/Measuring_rain_water_tank_level_with_an_Arduino.md)

- Published: 2024-03-28T00:00:00Z
- Updated: 2024-03-29T10:47:07Z
- Author: Joren
- ID: 543
- Canonical: https://0110.be/posts/Measuring_rain_water_tank_level_with_an_Arduino

- Tags: [UGent](https://0110.be/tags/UGent.md)

<div style="float:right;width:35%;max-width:300px;margin-left:10px;margin-bottom:10px;">
<center>
<img loading="lazy" style="width:100%"  src="https://0110.be/files/attachments/543/Diagram_zonder_titel.drawio.svg" ><br>
</center>
<small>Fig: Submersible water level meter.</small>
</div>

Due to the climate crisis, long droughts are becoming more common in Western Europe during the summers. Conversely, during the winters, it seems that there is more and more extreme rainfall. With [record breaking](https://www.meteo.be/nl/klimaat/klimaat-van-belgie/klimatologisch-overzicht/2024/februari) droughts and rainfall, it is essential that enough rainwater buffering capacity is available. As a private citizen this means installing a large rain water tank - perhaps larger than outdated models suggest - and using the captured water effectively, if at all possible.

<div style="float:left;width:15%;max-width:300px;margin-right:10px;margin-bottom:10px;">
<center>
<img loading="lazy" style="width:100%"  src="https://0110.be/files/attachments/543/submersible-water-level-sensor.jpg" ><br>
</center>
<small>Fig: Submersible water level meter.</small>
</div>

To effectively use rain-water, it helps to have an easy way to view the water level in the tank. This makes clear when to conserve water or when a pump might end up running dry and overheat. So I wanted to install **a water level measurement device in my rain water tank**.

My first attempt used sonar. This sends out a sound-wave which reflects on the water surface. The sonar measures the time it takes for the echo to return. This setup is finicky in an echoy tank but I managed to get it working. However, after couple of months the sonar stopped working in the damp environment.

Next I tried a optical, infra-red-based setup: the idea was to time the infra-red reflection on the water. After installation it appeared that water is transparent for infra-red. I basically measured the position of the floor of my tank. I took comfort in the fact that this measurement remained stable but had to look for a third option.

I finally became aware of sturdy, submersible pressure sensors which are designed for water level measurements. One of those is the QDY30A sensor, which is available in many versions but there is one which takes five volts as input and returns a 0 - 3.3V output: ideal to use with about any modern micro-controller. The sensor can be connected via a long cable. This helps to keep the Arduino in a dry place indoors. After recording a few measurements and the corresponding sensor depth, the sensor seems to show a very linear response: with two references, converting a sensor value to a depth in millimeters is doable. The readings ended up on a website and are [visualized via a SVG sparkline](https://alexplescan.com/posts/2023/07/08/easy-svg-sparklines/).

<center>
<svg height="70px" style="width:80%" viewBox="0 183.46000000000004 432 475.0" preserveAspectRatio="none">
  <path d="M 
        0 185.2199999999998 L
        1 186.0999999999999 L
        2 186.0999999999999 L
        3 183.46000000000004 L
        4 185.2199999999998 L
        5 185.2199999999998 L
        6 186.98999999999978 L
        7 186.98999999999978 L
        8 186.98999999999978 L
        9 190.51000000000022 L
        10 190.51000000000022 L
        11 200.19999999999982 L
        12 200.19999999999982 L
        13 220.46000000000004 L
        14 226.6199999999999 L
        15 225.73999999999978 L
        16 227.5 L
        17 228.3800000000001 L
        18 228.3800000000001 L
        19 232.78999999999996 L
        20 231.90999999999985 L
        21 236.30999999999995 L
        22 236.30999999999995 L
        23 237.19000000000005 L
        24 239.82999999999993 L
        25 240.71000000000004 L
        26 245.1199999999999 L
        27 246.0 L
        28 250.4000000000001 L
        29 254.80999999999995 L
        30 268.02 L
        31 301.4899999999998 L
        32 307.6500000000001 L
        33 310.3000000000002 L
        34 308.5300000000002 L
        35 308.5300000000002 L
        36 305.0100000000002 L
        37 305.0100000000002 L
        38 305.8899999999999 L
        39 304.1300000000001 L
        40 309.4200000000001 L
        41 308.5300000000002 L
        42 312.94000000000005 L
        43 312.94000000000005 L
        44 312.05999999999995 L
        45 312.05999999999995 L
        46 311.17999999999984 L
        47 312.94000000000005 L
        48 324.3899999999999 L
        49 312.94000000000005 L
        50 312.94000000000005 L
        51 314.6999999999998 L
        52 380.76 L
        53 389.56999999999994 L
        54 389.56999999999994 L
        55 389.56999999999994 L
        56 394.8499999999999 L
        57 397.49 L
        58 397.49 L
        59 397.49 L
        60 413.3499999999999 L
        61 423.03999999999996 L
        62 421.28 L
        63 422.1600000000001 L
        64 423.9200000000001 L
        65 424.79999999999995 L
        66 423.9200000000001 L
        67 421.28 L
        68 423.9200000000001 L
        69 425.68000000000006 L
        70 428.31999999999994 L
        71 425.68000000000006 L
        72 430.0799999999999 L
        73 430.0799999999999 L
        74 430.0799999999999 L
        75 425.68000000000006 L
        76 430.0799999999999 L
        77 434.49 L
        78 437.1300000000001 L
        79 438.01 L
        80 438.8900000000001 L
        81 437.1300000000001 L
        82 443.29999999999995 L
        83 439.77 L
        84 439.77 L
        85 439.77 L
        86 439.77 L
        87 437.1300000000001 L
        88 438.01 L
        89 435.3699999999999 L
        90 440.6500000000001 L
        91 439.77 L
        92 439.77 L
        93 442.4100000000001 L
        94 445.05999999999995 L
        95 442.4100000000001 L
        96 442.4100000000001 L
        97 442.4100000000001 L
        98 445.94000000000005 L
        99 444.18000000000006 L
        100 441.53 L
        101 441.53 L
        102 442.4100000000001 L
        103 444.18000000000006 L
        104 445.05999999999995 L
        105 445.94000000000005 L
        106 447.70000000000005 L
        107 449.46000000000004 L
        108 449.46000000000004 L
        109 451.22 L
        110 451.22 L
        111 449.46000000000004 L
        112 451.22 L
        113 447.70000000000005 L
        114 447.70000000000005 L
        115 447.70000000000005 L
        116 445.05999999999995 L
        117 444.18000000000006 L
        118 442.4100000000001 L
        119 442.4100000000001 L
        120 441.53 L
        121 440.6500000000001 L
        122 438.8900000000001 L
        123 439.77 L
        124 438.8900000000001 L
        125 437.1300000000001 L
        126 437.1300000000001 L
        127 439.77 L
        128 439.77 L
        129 445.05999999999995 L
        130 445.05999999999995 L
        131 444.18000000000006 L
        132 441.53 L
        133 442.4100000000001 L
        134 443.29999999999995 L
        135 444.18000000000006 L
        136 445.94000000000005 L
        137 441.53 L
        138 444.18000000000006 L
        139 447.70000000000005 L
        140 449.46000000000004 L
        141 459.1500000000001 L
        142 452.0999999999999 L
        143 452.0999999999999 L
        144 452.0999999999999 L
        145 468.8399999999999 L
        146 452.0999999999999 L
        147 449.46000000000004 L
        148 452.0999999999999 L
        149 452.98 L
        150 453.8599999999999 L
        151 452.98 L
        152 453.8599999999999 L
        153 452.0999999999999 L
        154 452.98 L
        155 452.98 L
        156 452.98 L
        157 456.51 L
        158 453.8599999999999 L
        159 454.75 L
        160 453.8599999999999 L
        161 455.6300000000001 L
        162 453.8599999999999 L
        163 453.8599999999999 L
        164 456.51 L
        165 456.51 L
        166 454.75 L
        167 453.8599999999999 L
        168 453.8599999999999 L
        169 453.8599999999999 L
        170 453.8599999999999 L
        171 451.22 L
        172 449.46000000000004 L
        173 451.22 L
        174 452.0999999999999 L
        175 452.98 L
        176 452.98 L
        177 451.22 L
        178 447.70000000000005 L
        179 467.96000000000004 L
        180 448.5799999999999 L
        181 447.70000000000005 L
        182 449.46000000000004 L
        183 447.70000000000005 L
        184 444.18000000000006 L
        185 448.5799999999999 L
        186 444.18000000000006 L
        187 444.18000000000006 L
        188 445.94000000000005 L
        189 452.0999999999999 L
        190 452.98 L
        191 452.0999999999999 L
        192 452.98 L
        193 452.98 L
        194 452.0999999999999 L
        195 452.0999999999999 L
        196 451.22 L
        197 453.8599999999999 L
        198 453.8599999999999 L
        199 453.8599999999999 L
        200 452.98 L
        201 449.46000000000004 L
        202 451.22 L
        203 445.05999999999995 L
        204 439.77 L
        205 430.0799999999999 L
        206 425.68000000000006 L
        207 423.9200000000001 L
        208 421.28 L
        209 411.5899999999999 L
        210 412.47 L
        211 411.5899999999999 L
        212 409.8299999999999 L
        213 414.23 L
        214 408.94000000000005 L
        215 407.18000000000006 L
        216 402.78 L
        217 403.6600000000001 L
        218 405.4200000000001 L
        219 402.78 L
        220 402.78 L
        221 400.1400000000001 L
        222 399.26 L
        223 405.4200000000001 L
        224 403.6600000000001 L
        225 402.78 L
        226 403.6600000000001 L
        227 408.94000000000005 L
        228 406.29999999999995 L
        229 409.8299999999999 L
        230 407.18000000000006 L
        231 416.8699999999999 L
        232 420.3900000000001 L
        233 419.51 L
        234 416.8699999999999 L
        235 417.75 L
        236 415.99 L
        237 434.49 L
        238 416.8699999999999 L
        239 425.68000000000006 L
        240 425.68000000000006 L
        241 440.6500000000001 L
        242 425.68000000000006 L
        243 438.01 L
        244 427.44000000000005 L
        245 429.20000000000005 L
        246 428.31999999999994 L
        247 434.49 L
        248 433.6099999999999 L
        249 439.77 L
        250 439.77 L
        251 439.77 L
        252 444.18000000000006 L
        253 439.77 L
        254 438.01 L
        255 439.77 L
        256 439.77 L
        257 438.8900000000001 L
        258 439.77 L
        259 431.8499999999999 L
        260 435.3699999999999 L
        261 433.6099999999999 L
        262 427.44000000000005 L
        263 430.0799999999999 L
        264 433.6099999999999 L
        265 433.6099999999999 L
        266 433.6099999999999 L
        267 435.3699999999999 L
        268 433.6099999999999 L
        269 433.6099999999999 L
        270 431.8499999999999 L
        271 437.1300000000001 L
        272 436.25 L
        273 435.3699999999999 L
        274 428.31999999999994 L
        275 430.0799999999999 L
        276 428.31999999999994 L
        277 438.01 L
        278 438.01 L
        279 437.1300000000001 L
        280 438.8900000000001 L
        281 438.8900000000001 L
        282 439.77 L
        283 438.8900000000001 L
        284 439.77 L
        285 442.4100000000001 L
        286 445.05999999999995 L
        287 448.5799999999999 L
        288 444.18000000000006 L
        289 443.29999999999995 L
        290 447.70000000000005 L
        291 450.3399999999999 L
        292 451.22 L
        293 452.0999999999999 L
        294 453.8599999999999 L
        295 452.98 L
        296 452.0999999999999 L
        297 451.22 L
        298 450.3399999999999 L
        299 453.8599999999999 L
        300 453.8599999999999 L
        301 456.51 L
        302 456.51 L
        303 456.51 L
        304 456.51 L
        305 458.27 L
        306 457.3900000000001 L
        307 460.9100000000001 L
        308 455.6300000000001 L
        309 460.03 L
        310 455.6300000000001 L
        311 456.51 L
        312 453.8599999999999 L
        313 453.8599999999999 L
        314 447.70000000000005 L
        315 449.46000000000004 L
        316 449.46000000000004 L
        317 448.5799999999999 L
        318 440.6500000000001 L
        319 445.05999999999995 L
        320 439.77 L
        321 434.49 L
        322 429.20000000000005 L
        323 424.79999999999995 L
        324 422.1600000000001 L
        325 416.8699999999999 L
        326 414.23 L
        327 410.71000000000004 L
        328 408.05999999999995 L
        329 400.1400000000001 L
        330 399.26 L
        331 401.9000000000001 L
        332 399.26 L
        333 424.79999999999995 L
        334 395.73 L
        335 391.3299999999999 L
        336 391.3299999999999 L
        337 388.69000000000005 L
        338 386.9200000000001 L
        339 385.1600000000001 L
        340 384.28 L
        341 405.4200000000001 L
        342 384.28 L
        343 382.52 L
        344 383.4000000000001 L
        345 382.52 L
        346 384.28 L
        347 383.4000000000001 L
        348 383.4000000000001 L
        349 381.6400000000001 L
        350 382.52 L
        351 383.4000000000001 L
        352 382.52 L
        353 383.4000000000001 L
        354 383.4000000000001 L
        355 382.52 L
        356 380.76 L
        357 383.4000000000001 L
        358 383.4000000000001 L
        359 380.76 L
        360 381.6400000000001 L
        361 381.6400000000001 L
        362 379.8800000000001 L
        363 384.28 L
        364 383.4000000000001 L
        365 383.4000000000001 L
        366 396.6099999999999 L
        367 439.77 L
        368 439.77 L
        369 462.6700000000001 L
        370 458.27 L
        371 466.20000000000005 L
        372 467.0799999999999 L
        373 472.3599999999999 L
        374 475.0 L
        375 473.24 L
        376 469.72 L
        377 465.31999999999994 L
        378 463.54999999999995 L
        379 466.20000000000005 L
        380 463.54999999999995 L
        381 461.78999999999996 L
        382 465.31999999999994 L
        383 463.54999999999995 L
        384 461.78999999999996 L
        385 458.27 L
        386 461.78999999999996 L
        387 461.78999999999996 L
        388 458.27 L
        389 461.78999999999996 L
        390 455.6300000000001 L
        391 456.51 L
        392 454.75 L
        393 453.8599999999999 L
        394 453.8599999999999 L
        395 453.8599999999999 L
        396 455.6300000000001 L
        397 453.8599999999999 L
        398 453.8599999999999 L
        399 453.8599999999999 L
        400 452.98 L
        401 452.0999999999999 L
        402 449.46000000000004 L
        403 448.5799999999999 L
        404 445.94000000000005 L
        405 449.46000000000004 L
        406 445.94000000000005 L
        407 444.18000000000006 L
        408 445.94000000000005 L
        409 445.05999999999995 L
        410 444.18000000000006 L
        411 442.4100000000001 L
        412 444.18000000000006 L
        413 440.6500000000001 L
        414 441.53 L
        415 449.46000000000004 L
        416 445.94000000000005 L
        417 445.05999999999995 L
        418 441.53 L
        419 443.29999999999995 L
        420 443.29999999999995 L
        421 442.4100000000001 L
        422 449.46000000000004 L
        423 445.94000000000005 L
        424 442.4100000000001 L
        425 442.4100000000001 L
        426 442.4100000000001 L
        427 456.51 L
        428 451.22 L
        429 463.54999999999995 L
        430 460.03 L
        431 450.3399999999999 L
        432 447.70000000000005 L
    " stroke-width="2" stroke="blue" fill="transparent" vector-effect="non-scaling-stroke"></path>
</svg><br/>
<small>Fig: Rain water level visualization for a few days, measured every 15 minutes. Going from 221cm to 197cm.</small>
</center>

With the Arduino code attached you should be able to get going. Next to reading and converting a sensor value, it also includes reading the median of several values to add some smoothing. The sensor is read on request: only when a serial message arrives a measurement is done.


---

## [Offloading authentication and user management to Keycloak - A minimal example with Nuxt and Litestar](https://0110.be/posts/Offloading_authentication_and_user_management_to_Keycloak_-_A_minimal_example_with_Nuxt_and_Litestar.md)

- Published: 2024-03-13T00:00:00Z
- Updated: 2024-03-19T09:13:26Z
- Author: Joren
- ID: 542
- Canonical: https://0110.be/posts/Offloading_authentication_and_user_management_to_Keycloak_-_A_minimal_example_with_Nuxt_and_Litestar

- Tags: [GhentCDH](https://0110.be/tags/GhentCDH.md), [UGent](https://0110.be/tags/UGent.md)

<div style="width:30%;float:right;margin-bottom:10px;margin-left:10px">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 193.036 39.861"><path fill="#4d4d4d" d="M5.795 9.869 11.511.003 34.53 0l5.685 9.964.007 19.932-5.691 9.958-23.012.008-5.782-9.965z"/><path fill="#ededed" d="M5.738 29.894h10.374l-5.698-10.041 4.634-9.982-9.252-.002L0 19.934"/><path fill="#e0e0e0" d="M19.258 29.894h7.583l6.705-9.773-6.588-10.156h-8.92l-5.373 9.814z"/><path fill="#acacac" d="m0 19.933 5.738 9.964h10.375l-5.636-9.93z"/><path fill="#9e9e9e" d="m12.774 19.935 6.485 9.962h7.582l6.6-9.958z"/><path fill="#00b8e3" d="m15.342 19.94-1.957.57-1.878-.571 7.667-13.29 1.918 3.318"/><path fill="#33c6e9" d="m21.084 29.894-1.908 3.332-5.093-5.487-2.58-7.797v-.004h3.838"/><path fill="#008aaa" d="M11.508 19.939h-.004v.003l-1.917 3.322-1.925-3.307 1.952-3.386 5.728-9.92h3.834"/><path fill="#d4d4d4" d="M32.604 29.894h11.612l-.007-19.93H32.604Z"/><path fill="#919191" d="M32.604 19.966v9.93h11.591v-9.93z"/><path fill="#00b8e3" d="M19.178 33.23h-3.837l-5.754-9.967 1.917-3.32z"/><path fill="#008aaa" d="M34.519 19.939 26.85 33.227c-.705-1.036-1.913-3.33-1.913-3.33l5.753-9.96z"/><path fill="#00b8e3" d="m30.68 33.227-3.83-.001 7.67-13.288 1.916-3.318 1.922 3.34m-3.839-.021h-3.828l-5.755-9.973 1.905-3.314 4.658 5.922z"/><path fill="#33c6e9" d="M36.436 16.618v.003l-1.917 3.318-7.677-13.286 3.841.002z"/><path fill="#626262" d="M175.972 9.98a.193.193 0 0 0-.195.196v19.503c0 .106.086.195.195.195h4.049c.106 0 .195-.09.195-.195V24.31c0-.046.016-.093.05-.13l.181-.204 1.6-1.782a.196.196 0 0 1 .302.016l1.528 2.06 2.735 3.68 1.002 1.347.367.497c.04.05.096.08.159.08h4.7a.2.2 0 0 0 .162-.312l-.973-1.356-1.389-1.954c-.413-.576-.856-1.198-1.333-1.866l-.215-.304-1.76-2.48a1565.7 1565.7 0 0 0-1.934-2.706.19.19 0 0 1 .016-.241l1.551-1.724 3.725-4.14 2.239-2.487a.218.218 0 0 0 .05-.123.195.195 0 0 0-.196-.201h-4.97a.195.195 0 0 0-.143.062l-1.558 1.694-3.324 3.614-2.235 2.428a.194.194 0 0 1-.338-.132v-7.471a.195.195 0 0 0-.195-.195Z"/><path fill="#6f6f6f" d="M161.562 9.98a.198.198 0 0 0-.178.12l-5.213 12.065-.003.003-.007.013-.003.01-.674 1.565-.04.096-.087.195h.001l-.073.166v.003l-2.027 4.693-.298.69a.196.196 0 0 0 .178.275h4.3a.196.196 0 0 0 .175-.112c0-.004.004-.004.004-.007l1.498-3.485.248-.576a.199.199 0 0 1 .182-.12h8.08a.19.19 0 0 1 .178.12l1.664 3.866 1.865-6.618-1.499-3.47-1.339-3.098-2.712-6.273a.191.191 0 0 0-.179-.12h-2.526zm7.905 19.58v.003l.086.192c.03.073.099.12.178.12h4.3a.197.197 0 0 0 .179-.276l-.04-.09-2.838-6.567zm-5.87-13.362c.074 0 .147.04.181.117l.943 2.2.952 2.225.285.664a.194.194 0 0 1-.179.272h-4.389a.194.194 0 0 1-.178-.272l.516-1.19 1.69-3.9a.195.195 0 0 1 .18-.116z"/><path fill="#7d7d7d" d="M143.452 9.524c-.826 0-1.617.076-2.368.235v.004-.004h-.003a9.78 9.78 0 0 0-3.556 1.488 10.59 10.59 0 0 0-1.497 1.224c-1.486 1.453-2.428 3.197-2.815 5.176l-.002.003-.014.076-.005.023-.042.225v-.001l-.003.012v.006l-.01.085v.009a11.29 11.29 0 0 0-.126 1.715c0 2.63.816 4.872 2.45 6.727.175.206.367.404.565.599.506.496 1.043.93 1.608 1.3 1.68 1.098 3.619 1.647 5.818 1.647.245 0 .486-.006.724-.023 2.13-.12 4.001-.784 5.615-1.991a10.44 10.44 0 0 0 1.089-.933l.01-.01a9.983 9.983 0 0 0 1.922-2.583c.148-.288.28-.582.396-.887.46-1.174.688-2.457.688-3.845 0-.374-.016-.742-.05-1.1v-.006a9.841 9.841 0 0 0-.783-3.1c-.5-1.15-1.227-2.191-2.183-3.124-.397-.39-.814-.74-1.25-1.052-1.76-1.263-3.817-1.895-6.178-1.895zm.017 3.873c1.66 0 3.059.625 4.197 1.875.062.067.122.136.175.205 1.022 1.214 1.531 2.66 1.531 4.336 0 1.17-.248 2.223-.744 3.162a6.456 6.456 0 0 1-1.138 1.545 5.658 5.658 0 0 1-1.382 1.048c-.79.423-1.67.635-2.64.635a5.57 5.57 0 0 1-2.56-.592 5.46 5.46 0 0 1-1.12-.77 5.668 5.668 0 0 1-.516-.503c-1.14-1.243-1.71-2.751-1.71-4.524 0-.053 0-.103.003-.156.03-1.707.599-3.168 1.707-4.386.83-.912 1.802-1.495 2.913-1.74a6.03 6.03 0 0 1 1.284-.135z"/><path fill="#888" d="M120.252 9.98a.193.193 0 0 0-.195.196v19.503c0 .106.086.195.195.195h12.528c.11 0 .196-.09.196-.195v-3.57a.195.195 0 0 0-.196-.194h-8.09a.192.192 0 0 1-.194-.191V10.176a.19.19 0 0 0-.113-.176.174.174 0 0 0-.083-.02h-2.242z"/><path fill="#949494" d="M109.792 9.525c-2.923 0-5.394.989-7.415 2.96-.367.36-.7.738-1.002 1.13v.004c-1.352 1.756-2.027 3.84-2.027 6.25 0 1.377.215 2.64.649 3.794l.006-.002-.005.003c.254.695.592 1.336.999 1.948v.003c.003 0 .003.003.003.003a9.828 9.828 0 0 0 1.323 1.58 10.01 10.01 0 0 0 1.984 1.512h.003a9.831 9.831 0 0 0 .953.484h.007l.003.003h.003c1.37.602 2.907.903 4.617.903.503 0 .996-.037 1.475-.106h.01c.308-.043.612-.102.913-.175 1.683-.404 3.225-1.257 4.63-2.557v-.002l.001.002c.281-.258.559-.54.83-.837a.199.199 0 0 0-.007-.27l-2.566-2.643a.19.19 0 0 0-.172-.057.212.212 0 0 0-.116.07c-.685.81-1.465 1.419-2.338 1.822-.867.4-1.826.6-2.874.6-.718 0-1.39-.113-2.011-.341a5.641 5.641 0 0 1-2.057-1.34 5.433 5.433 0 0 1-1.3-2.066h-.007l.007-.001c-.255-.715-.38-1.508-.38-2.385 0-1.723.512-3.118 1.544-4.183.076-.076.152-.153.235-.23 1.184-1.09 2.612-1.636 4.283-1.636.611 0 1.197.076 1.75.229v-.001c1.27.344 2.384 1.085 3.343 2.216.076.09.215.096.29.007l2.498-2.832a.201.201 0 0 0-.003-.264c-1.955-2.147-4.323-3.334-7.1-3.556-.322-.025-.646-.04-.977-.04z"/><path fill="#aaa" d="M82.588 9.98a.195.195 0 0 0-.17.29l1.892 3.309 3.423 5.983 1.38 2.41a.2.2 0 0 1 .026.097v7.61c0 .106.086.195.195.195h4.049c.109 0 .194-.09.194-.195v-7.61c0-.033.01-.066.027-.096l.976-1.706 3.704-6.476.757-1.32.503-.88h-.007l.007-.003.754-1.316a.194.194 0 0 0-.168-.29h-4.363a.196.196 0 0 0-.168.095l-3.953 6.803-.003.003v.003l-.212.156-.159.122a.203.203 0 0 1-.082-.076l-.067-.112-.099-.17-3.905-6.73a.196.196 0 0 0-.169-.095zm15.537 2.04v.002l-.004.002z"/><path fill="#bcbcbc" d="M66.598 9.98a.193.193 0 0 0-.196.196v19.503c0 .106.086.195.195.195h14.264c.11 0 .196-.09.196-.195v-3.54a.196.196 0 0 0-.196-.194h-9.825a.195.195 0 0 1-.196-.195v-3.737c0-.106.09-.196.196-.196h8.519a.195.195 0 0 0 .195-.194v-3.394c0-.11-.09-.195-.195-.195h-8.52a.196.196 0 0 1-.195-.195V14.13c0-.11.09-.195.196-.195h9.515a.195.195 0 0 0 .195-.195v-3.565a.195.195 0 0 0-.195-.195h-7.829z"/><path fill="#b8b8b8" d="M47.256 9.98a.193.193 0 0 0-.195.196v19.503c0 .106.086.195.195.195h4.048c.11 0 .196-.09.196-.195V24.31c0-.046.016-.093.05-.13l.842-.942.94-1.044a.196.196 0 0 1 .3.016l2.808 3.777.002.002 2.016 2.713.81 1.09a.19.19 0 0 0 .156.08h4.703a.197.197 0 0 0 .158-.31l-.171-.241a693.927 693.927 0 0 1-1.846-2.587c-.566-.79-1.194-1.673-1.888-2.652l-.07-.1v.002-.002a1569.226 1569.226 0 0 0-3.628-5.086.195.195 0 0 1 .017-.241l1.772-1.968h-.006l.006-.001v-.003l1.459-1.62 1.402-1.558 2.88-3.202a.194.194 0 0 0-.145-.324H59.1a.196.196 0 0 0-.146.063l-3.079 3.345-4.038 4.39a.194.194 0 0 1-.338-.132V10.17a.193.193 0 0 0-.195-.192h-2.11zm.091 9.823v.01h-.001zm12.27 8.34v.002h-.001z"/><path fill="#a0a0a0" d="M89.222 29.806c-.024-.025-.045-1.79-.045-3.92V22.01l-3.38-5.904c-1.996-3.487-3.364-5.945-3.342-6.003.032-.084.357-.098 2.278-.098 2.052 0 2.25.01 2.342.115.055.064.986 1.649 2.069 3.523 1.082 1.873 2.003 3.443 2.045 3.488.194.21.46-.181 2.48-3.662l2.01-3.465h2.275c1.894 0 2.28.016 2.31.094.02.05-1.477 2.737-3.326 5.969l-3.362 5.876-.066 7.872-2.121.018c-1.167.01-2.142-.003-2.167-.028z"/><path fill="#acacac" d="M66.456 29.767c-.017-.045-.023-4.503-.014-9.905l.017-9.823h14.22v3.837l-4.855.017c-3.453.012-4.88.038-4.944.09-.13.109-.13 3.91 0 4.018.063.052 1.362.079 4.448.09l4.36.018v3.638l-4.36.017c-3.086.012-4.385.039-4.448.09-.07.06-.089.465-.089 1.98 0 1.047.018 1.95.04 2.009.036.094.538.104 4.999.104 3.29 0 5 .023 5.086.069.122.065.128.156.128 1.872 0 1.314-.022 1.825-.08 1.883-.118.118-14.463.115-14.508-.003z"/></svg>
</div>

At the [Ghent Center for Digital Humanities](https://www.ghentcdh.ugent.be/) we provide software services for researchers. Think about, for example, annotation platforms for ancient texts or collaborative databases with geographically referenced historical data. Each of those services need some kind of authentication and user management: some parts of the service might be public, some only accessible for researchers at Ghent University and other parts need to be accessible e.g. to external researchers or collaborators. Providing authentication, login-flows and user management for each and every service quickly becomes tedious and, frankly, boring.

We went looking for a solution and stumbled on [Keycloak](https://www.keycloak.org/). Keycloak is an open source __Identity and Access Management__ system and is able to either authenticate users itself or pass through authenticate to other authentication providers like LDAP, GitHub, OAuth accounts, or others. It avoids the need to setup application-specific user management system. Flows like 'forget password', 'verify email', 'two factor authentication' are not part of your application itself but are provided by Keycloak. Leaving the developer to focus on application specific tasks.

<center>
<video src="https://0110.be/files/attachments/542/keycloak_screen-recording.mp4" style="width:70%" controls autoplay></video><br>
<small>Video: An API call to a protected back-end first fails. After authentication and receiving a JWT token, the back-end call succeeds. The authenticated session is then shown in Keycloak.</small>
</center>


Integration with Keycloak is a bit of work and not straightforward. As part of trying out Keycloak I have created a [minimal working example of a front-end / back-end system which uses Keycloak for authentication](https://github.com/GhentCDH/nuxt-keycloak-jwt-auth/). To get full access to the back-end API the user first needs a valid JWT-token provided by Keycloak. The flow can be seen in the video above. The dockerized environment can perhaps serve as inspiration for similar setups. Please do try out the [dockerized minimal working example](https://github.com/GhentCDH/nuxt-keycloak-jwt-auth/) and see if Keycloak can fit your use-case.





---
