Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/forms/openid_connect_authorize_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions app/services/identity_linker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ def initialize(user, service_provider)
@service_provider = service_provider
@ial = nil
@aal = nil
@acr_values = nil
@vtr = nil
@requested_aal_value = nil
end

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,
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions spec/forms/openid_connect_authorize_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spec/services/identity_linker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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),
Expand All @@ -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)
Expand Down