Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
passport-saml
Commits
fadd3e4a
Commit
fadd3e4a
authored
Nov 09, 2015
by
Ashima Athri
Browse files
Add test for new nameid attributes
parent
80da2879
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/tests.js
View file @
fadd3e4a
...
...
@@ -452,6 +452,40 @@ describe( 'passport-saml /', function() {
});
});
it
(
'
generateLogoutRequest adds the NameQualifier and SPNameQualifier to the saml request
'
,
function
(
done
)
{
var
expectedRequest
=
{
'
samlp:LogoutRequest
'
:
{
'
$
'
:
{
'
xmlns:samlp
'
:
'
urn:oasis:names:tc:SAML:2.0:protocol
'
,
'
xmlns:saml
'
:
'
urn:oasis:names:tc:SAML:2.0:assertion
'
,
//ID: '_85ba0a112df1ffb57805',
Version
:
'
2.0
'
,
//IssueInstant: '2014-05-29T03:32:23Z',
Destination
:
'
foo
'
},
'
saml:Issuer
'
:
[
{
_
:
'
onelogin_saml
'
,
'
$
'
:
{
'
xmlns:saml
'
:
'
urn:oasis:names:tc:SAML:2.0:assertion
'
}
}
],
'
saml:NameID
'
:
[
{
_
:
'
bar
'
,
'
$
'
:
{
Format
:
'
foo
'
,
SPNameQualifier
:
'
Service Provider
'
,
NameQualifier
:
'
Identity Provider
'
}
}
]
}
};
var
samlObj
=
new
SAML
(
{
entryPoint
:
"
foo
"
}
);
var
logoutRequest
=
samlObj
.
generateLogoutRequest
({
user
:
{
nameIDFormat
:
'
foo
'
,
nameID
:
'
bar
'
,
nameQualifier
:
'
Identity Provider
'
,
spNameQualifier
:
'
Service Provider
'
}
});
parseString
(
logoutRequest
,
function
(
err
,
doc
)
{
delete
doc
[
'
samlp:LogoutRequest
'
][
'
$
'
][
"
ID
"
];
delete
doc
[
'
samlp:LogoutRequest
'
][
'
$
'
][
"
IssueInstant
"
];
doc
.
should
.
eql
(
expectedRequest
);
done
();
});
});
it
(
'
generateLogoutResponse
'
,
function
(
done
)
{
var
expectedResponse
=
{
'
samlp:LogoutResponse
'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment