diff --git a/app/forms/openid_connect_authorize_form.rb b/app/forms/openid_connect_authorize_form.rb index bb2c5afb04d..95f81590e00 100644 --- a/app/forms/openid_connect_authorize_form.rb +++ b/app/forms/openid_connect_authorize_form.rb @@ -100,6 +100,8 @@ def link_identity_to_service_provider(current_user, rails_session_id) rails_session_id: rails_session_id, ial: ial_context.ial, aal: aal, + acr_values: acr_values&.join(' '), + vtr: vtr, requested_aal_value: requested_aal_value, scope: scope.join(' '), code_challenge: code_challenge, diff --git a/app/services/identity_linker.rb b/app/services/identity_linker.rb index 388524abf97..75a7e4b50dc 100644 --- a/app/services/identity_linker.rb +++ b/app/services/identity_linker.rb @@ -6,6 +6,8 @@ def initialize(user, service_provider) @service_provider = service_provider @ial = nil @aal = nil + @acr_values = nil + @vtr = nil @requested_aal_value = nil end @@ -13,6 +15,8 @@ def link_identity( code_challenge: nil, ial: nil, aal: nil, + acr_values: nil, + vtr: nil, requested_aal_value: nil, nonce: nil, rails_session_id: nil, @@ -30,6 +34,8 @@ def link_identity( code_challenge: code_challenge, ial: ial, aal: aal, + acr_values: acr_values, + vtr: vtr, requested_aal_value: requested_aal_value, nonce: nonce, rails_session_id: rails_session_id, diff --git a/spec/forms/openid_connect_authorize_form_spec.rb b/spec/forms/openid_connect_authorize_form_spec.rb index 3b8128759e0..38fd71ba28e 100644 --- a/spec/forms/openid_connect_authorize_form_spec.rb +++ b/spec/forms/openid_connect_authorize_form_spec.rb @@ -831,6 +831,8 @@ expect(identity.code_challenge).to eq(code_challenge) expect(identity.nonce).to eq(nonce) expect(identity.ial).to eq(1) + expect(identity.acr_values).to eq '' + expect(identity.vtr).to eq ['C1'].to_json end end end diff --git a/spec/services/identity_linker_spec.rb b/spec/services/identity_linker_spec.rb index 9e50e8e2211..99f1922f395 100644 --- a/spec/services/identity_linker_spec.rb +++ b/spec/services/identity_linker_spec.rb @@ -30,6 +30,8 @@ rails_session_id = SecureRandom.hex nonce = SecureRandom.hex ial = 3 + acr_values = 'http://idmanagement.gov/ns/assurance/aal/1' + vtr = ['C2.Pb'].to_json scope = 'openid profile email' code_challenge = SecureRandom.hex verified_attributes = %w[address email] @@ -38,6 +40,8 @@ rails_session_id: rails_session_id, nonce: nonce, ial: ial, + acr_values: acr_values, + vtr: vtr, scope: scope, code_challenge: code_challenge, verified_attributes: verified_attributes.map(&:to_sym), @@ -48,6 +52,8 @@ expect(last_identity.nonce).to eq(nonce) expect(last_identity.rails_session_id).to eq(rails_session_id) expect(last_identity.ial).to eq(ial) + expect(last_identity.acr_values).to eq(acr_values) + expect(last_identity.vtr).to eq(vtr) expect(last_identity.scope).to eq(scope) expect(last_identity.code_challenge).to eq(code_challenge) expect(last_identity.verified_attributes).to eq(verified_attributes)