Skip to content

Commit

Permalink
Extend and document the profile object
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbarth committed Sep 25, 2018
1 parent f82d141 commit 5365e62
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@ passport.use(new MultiSamlStrategy(
);
```

#### The profile object:

The profile object referenced above contains the following:

```typescript
interface Profile {
issuer?: string;
sessionIndex?: string;
nameID?: string;
nameIDFormat?: string;
nameQualifier?: string;
spNameQualifier?: string;
mail?: string;
email?: string;
getAssertionXml(): string;
getAssertion(): object;
ID?: string;
}
```

#### Config parameter details:

* **Core**
Expand Down
3 changes: 3 additions & 0 deletions lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,11 @@ SAML.prototype.processValidlySignedAssertion = function(xml, inResponseTo, callb
var nowMs = new Date().getTime();
var profile = {};
var assertion;
var parsedAssertion;
var parser = new xml2js.Parser(parserConfig);
Q.ninvoke(parser, 'parseString', xml)
.then(function(doc) {
parsedAssertion = doc;
assertion = doc.Assertion;

var issuer = assertion.Issuer;
Expand Down Expand Up @@ -867,6 +869,7 @@ SAML.prototype.processValidlySignedAssertion = function(xml, inResponseTo, callb
}

profile.getAssertionXml = function() { return xml; };
profile.getAssertion = function() { return parsedAssertion; };

callback(null, profile, false);
})
Expand Down

0 comments on commit 5365e62

Please sign in to comment.