@@ -115,6 +115,11 @@ def full_path(local_file):
115115 "acr" : INTERNETPROTOCOLPASSWORD ,
116116 "class" : "oidcop.user_authn.user.NoAuthn" ,
117117 "kwargs" : {"user" : "diana" },
118+ },
119+ "mfa" : {
120+ "acr" : 'https://refeds.org/profile/mfa' ,
121+ "class" : "oidcop.user_authn.user.NoAuthn" ,
122+ "kwargs" : {"user" : "diana" },
118123 }
119124 },
120125 "session_manager" : {
@@ -170,15 +175,15 @@ def create_session_manager(self):
170175 self .session_manager = self .endpoint_context .session_manager
171176 self .user_id = USER_ID
172177
173- def _create_session (self , auth_req , sub_type = "public" , sector_identifier = "" ):
178+ def _create_session (self , auth_req , sub_type = "public" , sector_identifier = "" , authn_info = '' ):
174179 if sector_identifier :
175180 authz_req = auth_req .copy ()
176181 authz_req ["sector_identifier_uri" ] = sector_identifier
177182 else :
178183 authz_req = auth_req
179184
180185 client_id = authz_req ["client_id" ]
181- ae = create_authn_event (self .user_id )
186+ ae = create_authn_event (self .user_id , authn_info = authn_info )
182187 return self .session_manager .create_session (
183188 ae , authz_req , self .user_id , client_id = client_id , sub_type = sub_type
184189 )
@@ -587,3 +592,20 @@ def test_id_token_info(self):
587592 get_sign_and_encrypt_algorithms (
588593 endpoint_context , client_info , payload_type = "id_token" , sign = True , encrypt = True
589594 )
595+
596+ def test_id_token_acr_claim (self ):
597+ _req = AREQS .copy ()
598+ _req ["claims" ] = {"id_token" : {"acr" : {"value" : "https://refeds.org/profile/mfa" }}}
599+
600+ session_id = self ._create_session (_req ,authn_info = "https://refeds.org/profile/mfa" )
601+ grant = self .session_manager [session_id ]
602+ code = self ._mint_code (grant , session_id )
603+ access_token = self ._mint_access_token (grant , session_id , code )
604+
605+ id_token = self ._mint_id_token (
606+ grant , session_id , token_ref = code , access_token = access_token .value
607+ )
608+
609+ _jwt = factory (id_token .value )
610+ _id_token_content = _jwt .jwt .payload ()
611+ assert _id_token_content ["acr" ] == "https://refeds.org/profile/mfa"
0 commit comments