-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13038 Add user context to the AuthnContextResolver
#10517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.feature 'Sign in with multiple vectors of trust', allowed_extra_analytics: [:*] do | ||
| include OidcAuthHelper | ||
| include IdvHelper | ||
| include DocAuthHelper | ||
|
|
||
| before do | ||
| allow(IdentityConfig.store).to receive(:doc_auth_selfie_capture_enabled).and_return(true) | ||
| end | ||
|
|
||
| context 'biometric and non-biometric proofing is acceptable' do | ||
| scenario 'identity proofing is not required if user is proofed with biometric' do | ||
| user = create(:user, :proofed_with_selfie) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr(vtr: ['C1.C2.P1.Pb', 'C1.C2.P1']) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to be_present | ||
| expect(user_info[:vot]).to eq('C1.C2.P1.Pb') | ||
| end | ||
|
|
||
| scenario 'identity proofing is not required if user is proofed without biometric' do | ||
| user = create(:user, :proofed) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr(vtr: ['C1.C2.P1.Pb', 'C1.C2.P1']) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to be_present | ||
| expect(user_info[:vot]).to eq('C1.C2.P1') | ||
| end | ||
|
|
||
| scenario 'identity proofing with biometric is required if user is not proofed', :js do | ||
| user = create(:user, :fully_registered) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr(vtr: ['C1.C2.P1.Pb', 'C1.C2.P1']) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(idv_welcome_path) | ||
| complete_all_doc_auth_steps_before_password_step(with_selfie: true) | ||
| fill_in 'Password', with: user.password | ||
| click_continue | ||
| acknowledge_and_confirm_personal_key | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to be_present | ||
| expect(user_info[:vot]).to eq('C1.C2.P1.Pb') | ||
| end | ||
| end | ||
|
|
||
| context 'proofing or no proofing is acceptable (IALMAX)' do | ||
| scenario 'identity proofing is not required if the user is not proofed' do | ||
| user = create(:user, :fully_registered) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr( | ||
| vtr: ['C1.C2.P1', 'C1.C2'], | ||
| scope: 'openid email profile:name', | ||
| ) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to_not be_present | ||
| expect(user_info[:vot]).to eq('C1.C2') | ||
| end | ||
|
|
||
| scenario 'attributes are shared if the user is proofed' do | ||
| user = create(:user, :proofed) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr( | ||
| vtr: ['C1.C2.P1', 'C1.C2'], | ||
| scope: 'openid email profile:name', | ||
| ) | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to be_present | ||
| expect(user_info[:vot]).to eq('C1.C2.P1') | ||
| end | ||
|
|
||
| scenario 'identity proofing is not required if proofed user resets password' do | ||
| user = create(:user, :proofed) | ||
|
|
||
| visit_idp_from_oidc_sp_with_vtr( | ||
| vtr: ['C1.C2.P1', 'C1.C2'], | ||
| scope: 'openid email profile:name', | ||
| ) | ||
| trigger_reset_password_and_click_email_link(user.email) | ||
| reset_password(user, 'new even better password') | ||
| user.password = 'new even better password' | ||
| sign_in_live_with_2fa(user) | ||
|
|
||
| expect(current_path).to eq(sign_up_completed_path) | ||
| click_agree_and_continue | ||
|
|
||
| user_info = OpenidConnectUserInfoPresenter.new(user.identities.last).user_info | ||
|
|
||
| expect(user_info[:given_name]).to_not be_present | ||
| expect(user_info[:vot]).to eq('C1.C2') | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am testing this in combination with 18F/identity-oidc-sinatra#163 and it looks like this is always picking
C1.P1from the vtr["C1.P1","C1"]. Is this correct? If we are trying to replicate ialmax, I would expectC1to be used in those cases (this is assuming I understand what ialmax is supposed to do)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, reading a little more I think i am confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, there is a little bug in here. Let me fix it up. I tested with
C1,C1.P1when I should be testing withC1.P1,C1.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
476fc5a has the fix