diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/data/vcr_cassettes/EHerkenningAuthContextTests/EHerkenningAuthContextTests.test_record_vestiging_restriction.yaml b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/data/vcr_cassettes/EHerkenningAuthContextTests/EHerkenningAuthContextTests.test_record_vestiging_restriction.yaml
new file mode 100644
index 0000000000..33cdb163db
--- /dev/null
+++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/data/vcr_cassettes/EHerkenningAuthContextTests/EHerkenningAuthContextTests.test_record_vestiging_restriction.yaml
@@ -0,0 +1,371 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ User-Agent:
+ - python-requests/2.32.2
+ method: GET
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/auth
+ response:
+ body:
+ string: "\n\n\n
\n \n
+ \ \n \n\n \n Sign
+ in to test\n \n \n \n \n \n \n\n\n\n\n\n\n"
+ headers:
+ Content-Language:
+ - en
+ Content-Security-Policy:
+ - frame-src 'self'; frame-ancestors 'self'; object-src 'none';
+ Content-Type:
+ - text/html;charset=utf-8
+ Referrer-Policy:
+ - no-referrer
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-Robots-Tag:
+ - none
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '1573'
+ status:
+ code: 400
+ message: Bad Request
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ User-Agent:
+ - python-requests/2.32.2
+ method: GET
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/auth?response_type=code&scope=openid+kvk&client_id=testid&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Feherkenning-oidc%2Fcallback%2F&state=not-a-random-string&nonce=not-a-random-string
+ response:
+ body:
+ string: "\n\n\n\n \n
+ \ \n \n\n \n Sign
+ in to test\n \n \n \n \n \n \n \n\n\n\n\n
+ \ \n
\n
+ \ \n
\n
+ \
\n\n\n
\n \n\n\n\n\n\n
+ \
\n
\n\n
\n
\n\n\n"
+ headers:
+ Cache-Control:
+ - no-store, must-revalidate, max-age=0
+ Content-Language:
+ - en
+ Content-Security-Policy:
+ - frame-src 'self'; frame-ancestors 'self'; object-src 'none';
+ Content-Type:
+ - text/html;charset=utf-8
+ Referrer-Policy:
+ - no-referrer
+ Set-Cookie:
+ - AUTH_SESSION_ID=35e8d5a1-245e-4ae5-b073-832f1c666996; Version=1; Path=/realms/test/;
+ SameSite=None; Secure; HttpOnly
+ - AUTH_SESSION_ID_LEGACY=35e8d5a1-245e-4ae5-b073-832f1c666996; Version=1; Path=/realms/test/;
+ HttpOnly
+ - KC_RESTART=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlNzE1ZTA1MS02Y2RiLTQ4Y2MtYjRmNC1mMDcyMmM4MWY5ZDMifQ.eyJjaWQiOiJ0ZXN0aWQiLCJwdHkiOiJvcGVuaWQtY29ubmVjdCIsInJ1cmkiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAvZWhlcmtlbm5pbmctb2lkYy9jYWxsYmFjay8iLCJhY3QiOiJBVVRIRU5USUNBVEUiLCJub3RlcyI6eyJzY29wZSI6Im9wZW5pZCBrdmsiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcmVhbG1zL3Rlc3QiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsInJlZGlyZWN0X3VyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9laGVya2VubmluZy1vaWRjL2NhbGxiYWNrLyIsInN0YXRlIjoibm90LWEtcmFuZG9tLXN0cmluZyIsIm5vbmNlIjoibm90LWEtcmFuZG9tLXN0cmluZyJ9fQ.8Me56DCFR5bLdeB5ofc-CuoI9b7hc0w7Lc7eKn6tu-A;
+ Version=1; Path=/realms/test/; HttpOnly
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-Robots-Tag:
+ - none
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '4466'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: username=eherkenning-vestiging&password=eherkenning-vestiging&credentialId=&login=Sign+In
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '89'
+ Content-Type:
+ - application/x-www-form-urlencoded
+ Cookie:
+ - AUTH_SESSION_ID_LEGACY=35e8d5a1-245e-4ae5-b073-832f1c666996; KC_RESTART=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlNzE1ZTA1MS02Y2RiLTQ4Y2MtYjRmNC1mMDcyMmM4MWY5ZDMifQ.eyJjaWQiOiJ0ZXN0aWQiLCJwdHkiOiJvcGVuaWQtY29ubmVjdCIsInJ1cmkiOiJodHRwOi8vbG9jYWxob3N0OjgwMDAvZWhlcmtlbm5pbmctb2lkYy9jYWxsYmFjay8iLCJhY3QiOiJBVVRIRU5USUNBVEUiLCJub3RlcyI6eyJzY29wZSI6Im9wZW5pZCBrdmsiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcmVhbG1zL3Rlc3QiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsInJlZGlyZWN0X3VyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9laGVya2VubmluZy1vaWRjL2NhbGxiYWNrLyIsInN0YXRlIjoibm90LWEtcmFuZG9tLXN0cmluZyIsIm5vbmNlIjoibm90LWEtcmFuZG9tLXN0cmluZyJ9fQ.8Me56DCFR5bLdeB5ofc-CuoI9b7hc0w7Lc7eKn6tu-A
+ User-Agent:
+ - python-requests/2.32.2
+ method: POST
+ uri: http://localhost:8080/realms/test/login-actions/authenticate?session_code=n8PB65X2Mz-Io--S1eAV_2XD-59Pt9Ix4UG_7RZetXA&execution=d8b8778e-a545-45d4-8f72-fd69facf4b72&client_id=testid&tab_id=BZeD_i00vt0
+ response:
+ body:
+ string: ''
+ headers:
+ Cache-Control:
+ - no-store, must-revalidate, max-age=0
+ Content-Security-Policy:
+ - frame-src 'self'; frame-ancestors 'self'; object-src 'none';
+ Location:
+ - http://localhost:8000/eherkenning-oidc/callback/?state=not-a-random-string&session_state=35e8d5a1-245e-4ae5-b073-832f1c666996&iss=http%3A%2F%2Flocalhost%3A8080%2Frealms%2Ftest&code=a8decc28-6b10-4fad-90da-9b436a99cff8.35e8d5a1-245e-4ae5-b073-832f1c666996.adf4ad83-4550-4619-9231-73bd8d700f45
+ Referrer-Policy:
+ - no-referrer
+ Set-Cookie:
+ - KEYCLOAK_LOCALE=; Version=1; Comment=Expiring cookie; Expires=Thu, 01-Jan-1970
+ 00:00:10 GMT; Max-Age=0; Path=/realms/test/; HttpOnly
+ - KC_RESTART=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0;
+ Path=/realms/test/; HttpOnly
+ - KC_AUTH_STATE=; Version=1; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Max-Age=0;
+ Path=/realms/test/
+ - KEYCLOAK_IDENTITY=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlNzE1ZTA1MS02Y2RiLTQ4Y2MtYjRmNC1mMDcyMmM4MWY5ZDMifQ.eyJleHAiOjE3MjAwMzY0MjUsImlhdCI6MTcyMDAwMDQyNSwianRpIjoiYmQwNWRkZjUtZTA0Ni00YWMyLThiN2MtOWZmOTEyZDdlYWFmIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL3JlYWxtcy90ZXN0Iiwic3ViIjoiNDRiZTQ1ZjYtYTdhZS00MmMyLTk0ODYtMzBmMDc4Y2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f5b39/35e8d5a1-245e-4ae5-b073-832f1c666996;
+ Version=1; Expires=Wed, 03-Jul-2024 19:53:45 GMT; Max-Age=36000; Path=/realms/test/;
+ SameSite=None; Secure
+ - KEYCLOAK_SESSION_LEGACY=test/44be45f6-a7ae-42c2-9486-30f078cf5b39/35e8d5a1-245e-4ae5-b073-832f1c666996;
+ Version=1; Expires=Wed, 03-Jul-2024 19:53:45 GMT; Max-Age=36000; Path=/realms/test/
+ - KEYCLOAK_REMEMBER_ME=; Version=1; Comment=Expiring cookie; Expires=Thu, 01-Jan-1970
+ 00:00:10 GMT; Max-Age=0; Path=/realms/test/; HttpOnly
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-Robots-Tag:
+ - none
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '0'
+ status:
+ code: 302
+ message: Found
+- request:
+ body: client_id=testid&client_secret=7DB3KUAAizYCcmZufpHRVOcD0TOkNO3I&grant_type=authorization_code&code=a8decc28-6b10-4fad-90da-9b436a99cff8.35e8d5a1-245e-4ae5-b073-832f1c666996.adf4ad83-4550-4619-9231-73bd8d700f45&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Feherkenning-oidc%2Fcallback%2F
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ Content-Length:
+ - '285'
+ Content-Type:
+ - application/x-www-form-urlencoded
+ User-Agent:
+ - python-requests/2.32.2
+ method: POST
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/token
+ response:
+ body:
+ string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0VU5RQWN2VWN2LURGVU94XzRPMWd0MTNPZEpTb3RxRUtQWnVyczJ2UVc4In0.eyJleHAiOjE3MjAwMDA3MjUsImlhdCI6MTcyMDAwMDQyNSwiYXV0aF90aW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sIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXSwicHJlZmVycmVkX3VzZXJuYW1lIjoiZWhlcmtlbm5pbmctdmVzdGlnaW5nIiwidmVzdGlnaW5nIjoiMTIzNDU2Nzg5MDEyIn0.Ht8g4r-WD_BQzwJ7ciJcbHC7rKgly2iKjDsslfoL9K7V4q7S-hPPSAneMxdo-cVLVuSMebBMDLegef5zWUnQkBE1O1t0Co3HPLrmaT1Tdvd4XPZY5EyWQQHQatBoiO3dVyL9CA4pehk8RloRFNSX2_4UaeXu9pMCZ9kNrIDvPKGbhXVqJqKGF95N8Uo88rR7WXPKtb18bru7C0DkMI2hrftpyMZZ5-VPhDuJQsLqd02bmchBMeXYjGz7_eaA7pyATSzDlsDb1xkPLh_jzodED7mJfMoN74Pr7YbfOq2h8mz4Ra6RBlGdFAu07fEI6qeoy73Tzegn0_1UuLkcXzTfJQ","not-before-policy":0,"session_state":"35e8d5a1-245e-4ae5-b073-832f1c666996","scope":"openid
+ email profile kvk groups bsn"}'
+ headers:
+ Cache-Control:
+ - no-store
+ Content-Type:
+ - application/json
+ Pragma:
+ - no-cache
+ Referrer-Policy:
+ - no-referrer
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '4029'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ User-Agent:
+ - python-requests/2.32.2
+ method: GET
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/certs
+ response:
+ body:
+ string: '{"keys":[{"kid":"4UNQAcvUcv-DFUOx_4O1gt13OdJSotqEKPZurs2vQW8","kty":"RSA","alg":"RS256","use":"sig","n":"2DOZ0qHie73SuFVR7civrl6r82YUiAghfzaMowjCg0o06AF--2l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quZIAFiWRQwegqcyK9turt21exfUW60Lt2G3Py799xMMpLHC85ylmWNjG7NyM/6xTb97FV/7x6R+Ax1pSru0CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAQGJHeTYSMvp0yndbIn7DLohO9lom5nRrx/bLyb7TiRfogyJEF6rQZ66CAkQFk5eMF878fsHTuMVjtmXVBnhojhVmK91HwjsNQu/8xR6QMXNKJQMvHR245vwUGxlWRw/36ObM1D7QjCd/q+FonpBEY4m5Y6Uz1U0HR2Cbh0E2afVlPLeV+F0LKrlyVMdIaWBGWftCGIKDAHaG/PD66zbAKtxerv2fBIDq100WHPhd57BZxX+2aGJp1IaRDgkxV0E/CjEy3+Knd8xbAgUSW0Tl6OTC75exIvlbzeluEBe0wlapAb7WvBKYsipSW8G8Ey7tjoolDT4AU82EaKUPstiMnA=="],"x5t":"AlfHDI0FOPQpt3RBAILt0dtW1yw","x5t#S256":"a7bhm8-JsnfY7bL_m8Yl72hgmp5516VZlFcVloKzk08"}]}'
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/json;charset=UTF-8
+ Referrer-Policy:
+ - no-referrer
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '2909'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Authorization:
+ - Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0VU5RQWN2VWN2LURGVU94XzRPMWd0MTNPZEpTb3RxRUtQWnVyczJ2UVc4In0.eyJleHAiOjE3MjAwMDA3MjUsImlhdCI6MTcyMDAwMDQyNSwiYXV0aF90aW1lIjoxNzIwMDAwNDI1LCJqdGkiOiI3ODQ5ZTcxOS0xNGY0LTQ4NGYtOGY5Ni1lYTI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UiOiJlaGVya2VubmluZy12ZXN0aWdpbmciLCJ2ZXN0aWdpbmciOiIxMjM0NTY3ODkwMTIifQ.djXI04yg-TIrn4iQAV9ePqy0KL7VEpayJdh0RqLmt-8t4I0aY93An2TL9gGD4lMS_J813rlze1txka3ivx-AImQfT80VjVj4rdhq_8m0ow3fdpzWDH92BD5qcHBsq6_u7VPqOrctLfhvho8sPGcBoUcByaYvipG_V1UWKlptAY3BebBjmGpSrZavTkX5A1AdSUL5uNwehuz8BOydDMBGcyLwkdj2r9PkQ83jJXOMKrXANKgWFcCmXeHchxAgVPMM0m5YWCZUgcldcBC6WcraeAsB4oRxxdjrSuEDIIIgXIUGo1fb_doWO0U9EanDKbxlmHKE_iYLks834PMwyxX8ag
+ Connection:
+ - keep-alive
+ User-Agent:
+ - python-requests/2.32.2
+ method: GET
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/userinfo
+ response:
+ body:
+ string: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0VU5RQWN2VWN2LURGVU94XzRPMWd0MTNPZEpTb3RxRUtQWnVyczJ2UVc4In0.eyJzdWIiOiI0NGJlNDVmNi1hN2FlLTQyYzItOTQ4Ni0zMGYwNzhjZjViMzkiLCJhdWQiOiJ0ZXN0aWQiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImxlZ2FsU3ViamVjdElEIjoiMTIzNDU2NzgiLCJhY3RpbmdTdWJqZWN0SUQiOiI0Qjc1QTBFQTEwN0IzRDM2IiwibmFtZV9xdWFsaWZpZXIiOiJ1cm46ZXRvZWdhbmc6MS45OkVudGl0eUNvbmNlcm5lZElEOkt2S25yIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL3JlYWxtcy90ZXN0IiwiZ3JvdXBzIjpbImRlZmF1bHQtcm9sZXMtdGVzdCIsIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXSwicHJlZmVycmVkX3VzZXJuYW1lIjoiZWhlcmtlbm5pbmctdmVzdGlnaW5nIiwidmVzdGlnaW5nIjoiMTIzNDU2Nzg5MDEyIn0.SvJBCCIEMLYvA0QotatwGowE-q85L_El58-Um2YOmqTmOjWuHe6aPMgE3KN51uwJDtfrMqsna-0Or-u1k32f4SiT6Wh2o62ajKkP-mjwux5m0qJ28-pg-AfArzgkGNuEUzZsEL5zbewNYD7VoJy0JaX-TqtRXibasdUIgzVK4aBsMRjnjfAnK8r5xzIbIbDJ6UN5Lclhojoi_SmThw9RRUizCfYKhvwypv9RpmwvyWEP4zB_BUPBWoooi1ESgXjIpP351rxmEet27flJjzKaSNVnqni3plhXMf2lyCV14frNLsWvQKGEaGQda3s0RvUvm_0Czz2EzgAE2Ts_JR-VFg
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/jwt
+ Referrer-Policy:
+ - no-referrer
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '978'
+ status:
+ code: 200
+ message: OK
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate, br
+ Connection:
+ - keep-alive
+ User-Agent:
+ - python-requests/2.32.2
+ method: GET
+ uri: http://localhost:8080/realms/test/protocol/openid-connect/certs
+ response:
+ body:
+ string: '{"keys":[{"kid":"4UNQAcvUcv-DFUOx_4O1gt13OdJSotqEKPZurs2vQW8","kty":"RSA","alg":"RS256","use":"sig","n":"2DOZ0qHie73SuFVR7civrl6r82YUiAghfzaMowjCg0o06AF--2lIS7vNV_PbsVVznPAAMqVrNG-8CcevEzvVZMQD9nH4DI7xlOxK0lrYu8rmMeSfOvXVbBVsWBZe0jnGNukZqjwmRE5__ttJdxPfIBT5-2L6mguQbDfhSUEEdIW7y7UfOXvqLqEcBtoIEB-ORKDTUIQwGZM5mSCy-cY3cHvvZfZVgaUUy5NvujPRXTMje4n_hG0KfEV-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jsNQu/8xR6QMXNKJQMvHR245vwUGxlWRw/36ObM1D7QjCd/q+FonpBEY4m5Y6Uz1U0HR2Cbh0E2afVlPLeV+F0LKrlyVMdIaWBGWftCGIKDAHaG/PD66zbAKtxerv2fBIDq100WHPhd57BZxX+2aGJp1IaRDgkxV0E/CjEy3+Knd8xbAgUSW0Tl6OTC75exIvlbzeluEBe0wlapAb7WvBKYsipSW8G8Ey7tjoolDT4AU82EaKUPstiMnA=="],"x5t":"AlfHDI0FOPQpt3RBAILt0dtW1yw","x5t#S256":"a7bhm8-JsnfY7bL_m8Yl72hgmp5516VZlFcVloKzk08"}]}'
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/json;charset=UTF-8
+ Referrer-Policy:
+ - no-referrer
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - SAMEORIGIN
+ X-XSS-Protection:
+ - 1; mode=block
+ content-length:
+ - '2909'
+ status:
+ code: 200
+ message: OK
+version: 1
diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/test_auth_context_data.py b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/test_auth_context_data.py
index ce28742b27..d73b6b1b96 100644
--- a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/test_auth_context_data.py
+++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/test_auth_context_data.py
@@ -122,6 +122,29 @@ def test_record_auth_context(self):
)
self.assertNotIn("representee", auth_context)
+ @mock_eherkenning_config(branch_number_claim=["vestiging"])
+ def test_record_vestiging_restriction(self):
+ self._login_and_start_form(
+ "eherkenning_oidc",
+ username="eherkenning-vestiging",
+ password="eherkenning-vestiging",
+ )
+
+ submission = Submission.objects.get()
+ self.assertTrue(submission.is_authenticated)
+ auth_context = submission.auth_info.to_auth_context_data()
+
+ self.assertValidContext(auth_context)
+ self.assertEqual(auth_context["source"], "eherkenning")
+ self.assertEqual(
+ auth_context["authorizee"]["legalSubject"],
+ {
+ "identifierType": "kvkNummer",
+ "identifier": "12345678",
+ "branchNumber": "123456789012",
+ },
+ )
+
@override_settings(ALLOWED_HOSTS=["*"])
class DigiDMachtigenAuthContextTests(
@@ -308,3 +331,26 @@ def test_new_required_claims_are_backwards_compatible(self):
with self.subTest("legacy structure"):
machtigen = submission.auth_info.machtigen
self.assertEqual(machtigen, {"identifier_value": "12345678"})
+
+ @mock_eherkenning_bewindvoering_config(branch_number_claim=["vestiging"])
+ def test_record_vestiging_restriction(self):
+ self._login_and_start_form(
+ "eherkenning_oidc",
+ username="eherkenning-vestiging",
+ password="eherkenning-vestiging",
+ )
+
+ submission = Submission.objects.get()
+ self.assertTrue(submission.is_authenticated)
+ auth_context = submission.auth_info.to_auth_context_data()
+
+ self.assertValidContext(auth_context)
+ self.assertEqual(auth_context["source"], "eherkenning")
+ self.assertEqual(
+ auth_context["authorizee"]["legalSubject"],
+ {
+ "identifierType": "kvkNummer",
+ "identifier": "12345678",
+ "branchNumber": "123456789012",
+ },
+ )