Skip to content

Commit

Permalink
docs(readme): Document createUnsignedAssertion()
Browse files Browse the repository at this point in the history
  • Loading branch information
Eva Sarafianou committed May 13, 2021
1 parent 7ee7984 commit 4646240
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Create SAML assertions. Supports SAML 1.1 and SAML 2.0 tokens.

### Usage

#### Signed Assertions

```js
var saml = require('saml').Saml20; // or Saml11

Expand All @@ -20,14 +22,42 @@ var options = {
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'Foo Bar'
},
nameIdentifier: 'foo',
sessionIndex: '_faed468a-15a0-4668-aed6-3d9c478cc8fa'
sessionIndex: '_faed468a-15a0-4668-aed6-3d9c478cc8fa',
};

var signedAssertion = saml.create(options);
saml.create(options, (err, samlAssertion) => {
if (err) { throw new Error(err) }
console.log(samlAssertion)
})
```

Everything except the cert and key is optional.

#### Unsigned Assertions

```js
var saml = require('saml').Saml20; // or Saml11

var options = {
issuer: 'urn:issuer',
lifetimeInSeconds: 600,
audiences: 'urn:myapp',
attributes: {
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'foo@bar.com',
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'Foo Bar'
},
nameIdentifier: 'foo',
sessionIndex: '_faed468a-15a0-4668-aed6-3d9c478cc8fa',
};

saml.createUnsignedAssertion(options, (err, samlAssertion) => {
if (err) { throw new Error(err) }
console.log(samlAssertion)
})
```

All options are optional

## Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.
Expand Down

0 comments on commit 4646240

Please sign in to comment.