diff --git a/CHANGELOG.md b/CHANGELOG.md index b7796f3..0ba047b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +- include ACR claim in ID token only if requested (#32) + ## [1.0.8] - 2025-09-10 - fix secrets submodule path following move to `proconnect-gouv` organization - update other references to `numerique-gouv` organization diff --git a/docker/oidc-test-client/app.py b/docker/oidc-test-client/app.py index 201a4db..d6ac74c 100644 --- a/docker/oidc-test-client/app.py +++ b/docker/oidc-test-client/app.py @@ -2,13 +2,10 @@ from flask import Flask, jsonify, request, session from oic.oic import Client from oic.utils.authn.client import CLIENT_AUTHN_METHOD from oic import rndstr -from oic.oic.message import RegistrationResponse +from oic.oic.message import Claims, ClaimsRequest, RegistrationResponse from oic.utils.http_util import Redirect from oic.oic.message import AuthorizationResponse import secrets -import webbrowser -import threading -import time import logging import os @@ -52,6 +49,7 @@ def index(): "nonce": session["nonce"], "redirect_uri": client.registration_response["redirect_uris"][0], "state": session["state"], + "claims": ClaimsRequest(id_token=Claims(acr=None, amr=None)), } ) login_url = auth_req.request(client.authorization_endpoint) diff --git a/docker/oidc-test-client/requirements.txt b/docker/oidc-test-client/requirements.txt index 7ee47b1..9651550 100644 --- a/docker/oidc-test-client/requirements.txt +++ b/docker/oidc-test-client/requirements.txt @@ -1,2 +1,2 @@ Flask==3.0.3 -oic==1.6.1 +oic==1.7.0 diff --git a/src/satosa/plugins/frontends/openid_connect_frontend.yaml b/src/satosa/plugins/frontends/openid_connect_frontend.yaml index 8bf9d66..9505bad 100644 --- a/src/satosa/plugins/frontends/openid_connect_frontend.yaml +++ b/src/satosa/plugins/frontends/openid_connect_frontend.yaml @@ -56,8 +56,3 @@ config: - given_name usual_name: - usual_name - extra_id_token_claims: - oidc-test-client: - - acr - agent-connect: - - acr diff --git a/src/satosa/tests/test_e2e.py b/src/satosa/tests/test_e2e.py index 20ab6fa..cef255d 100644 --- a/src/satosa/tests/test_e2e.py +++ b/src/satosa/tests/test_e2e.py @@ -20,6 +20,7 @@ def renater_test_idp(page, login): def renater_wayf(page): page.get_by_text("Veuillez sélectionner").click() + page.get_by_role("searchbox").fill("GIP RENATER - IdP de test") page.get_by_role("option", name="GIP RENATER - IdP de test", exact=True).click() page.get_by_role("button", name="Sélection").click() @@ -125,7 +126,7 @@ def test_pro_connect_to_renater_student_not_allowed(page: Page): renater_wayf(page) renater_test_idp(page, login="etudiant1") - expect(page.locator("body")).to_contain_text("Une erreur technique est survenue.") + expect(page.locator("body")).to_contain_text("access_denied") @pytest.mark.skipif(