ask for amr (Authentication Methods References)

This commit is contained in:
simon lehericey 2024-09-11 10:18:46 +02:00
parent 1e9982927a
commit 5f25756ae2
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -17,7 +17,9 @@ class AgentConnectService
scope: [:openid, :email, :given_name, :usual_name, :organizational_unit, :belonging_population, :siret, :idp_id],
state:,
nonce:,
acr_values: 'eidas1'
acr_values: 'eidas1',
claims: { id_token: { amr: { essential: true } } }.to_json,
prompt: :login
)
[uri, state, nonce]
@ -32,7 +34,9 @@ class AgentConnectService
id_token = ResponseObject::IdToken.decode(access_token.id_token, conf[:jwks])
id_token.verify!(conf.merge(nonce: nonce))
[access_token.userinfo!.raw_attributes, access_token.id_token]
amr = id_token.amr.present? ? JSON.parse(id_token.amr) : []
[access_token.userinfo!.raw_attributes, access_token.id_token, amr]
end
private