Skip to content

Commit a4f7aff

Browse files
authored
Merge pull request #200 from waterkip/GH-195-nameformatid_deprecation_warning
Add deprecation warning for nameid_format in Protocol::AuthnRequest
2 parents 4920a03 + 70890a1 commit a4f7aff

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

lib/Net/SAML2/Protocol/AuthnRequest.pm

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ around BUILDARGS => sub {
179179

180180
my %params = @_;
181181
if ($params{nameid_format} && !defined $params{nameidpolicy_format}) {
182+
warn "You are using nameid_format, this field has changed to "
183+
. "nameidpolicy_format. This field will be used for other purposes "
184+
. "in an upcoming release. Please change your code ASAP.";
182185
$params{nameidpolicy_format} = $params{nameid_format};
183186
}
184187

lib/Net/SAML2/SP.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ sub authn_request {
322322
my (%params) = @_;
323323

324324
return Net::SAML2::Protocol::AuthnRequest->new(
325-
issueinstant => DateTime->now,
326-
issuer => $self->id,
327-
destination => $destination,
328-
nameid_format => $nameid_format || '',
325+
issueinstant => DateTime->now,
326+
issuer => $self->id,
327+
destination => $destination,
328+
nameidpolicy_format => $nameid_format || '',
329329
%params,
330330
);
331331

t/09-authn-request.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $override->override('Net::SAML2::Protocol::AuthnRequest::_build_id' =>
1717
{
1818
my ($ar, $xp) = net_saml2_authnreq(
1919
nameid => 'mynameid',
20-
nameid_format =>
20+
nameidpolicy_format =>
2121
'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
2222
nameid_allow_create => 1,
2323
issuer_namequalifier => 'bar',

0 commit comments

Comments
 (0)