Skip to content

Commit

Permalink
Merge pull request #38 from 18F/add-default-aal-authn-context
Browse files Browse the repository at this point in the history
add default aal authn context
  • Loading branch information
achapm authored Apr 7, 2021
2 parents e5ca445 + e21de03 commit fd7c822
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/saml_idp/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SamlIdp
class Request
IAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/ial}.freeze
LOA_PREFIX = %r{^http://idmanagement.gov/ns/assurance/loa}.freeze
AAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/aal}.freeze
AAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/aal|urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo}.freeze

def self.from_deflated_request(raw, options = {})
if raw
Expand Down
2 changes: 1 addition & 1 deletion lib/saml_idp/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# encoding: utf-8
module SamlIdp
VERSION = '0.12.1-18f'.freeze
VERSION = '0.12.2-18f'.freeze
end
9 changes: 9 additions & 0 deletions spec/lib/saml_idp/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module SamlIdp
describe Request do
let(:aal) { 'http://idmanagement.gov/ns/assurance/aal/3' }
let(:default_aal) { 'urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo' }
let(:ial) { 'http://idmanagement.gov/ns/assurance/ial/2' }
let(:password) { 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password' }
let(:authn_context_classref) { build_authn_context_classref(password) }
Expand Down Expand Up @@ -133,6 +134,14 @@ module SamlIdp
end
end

context "context requested is default aal" do
let(:authn_context_classref) { build_authn_context_classref(default_aal) }

it "should return the aal uri" do
expect(subject.requested_aal_authn_context).to eq(default_aal)
end
end

context "only context requested is aal" do
let(:authn_context_classref) { build_authn_context_classref(aal) }

Expand Down

0 comments on commit fd7c822

Please sign in to comment.