Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneRifle committed Jan 14, 2019
1 parent ca261e3 commit 41a54d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ app.route('/login', (req, res) => {
// by GET-ing a pre-agreed endpoint, proceed to obtain the user's
// identity using out-of-band (OOB) authentication
app.route('/assert', (req, res) => {
const { SAMLArt: samlArt, RelayState: relayState } = req.query
const { SAMLart: samlArt, RelayState: relayState } = req.query
client.getAttributes(samlArt, relayState, (err, data) => {
// If all is well and login occurs, the attributes are given
// In all cases, the relayState as provided in getAttributes() is given
const { attributes, relayState } = data
// For SingPass, a user name will be given
// Refer to unit tests to infer what CorpPass will give
const { UserName: userName } = attributes
if (err) {
// Indicate through cookies or headers that an error has occurred
console.error(err)
res.cookie('login.error', err.message)
} else {
// For SingPass, a user `name will be given
// Refer to unit tests to infer what CorpPass will give
const { UserName: userName } = attributes
// Embed a session cookie or pass back some Authorization bearer token
const FOUR_HOURS = 4 * 60 * 60 * 1000
const jwt = client.createJWT({ userName }, FOUR_HOURS)
Expand Down

0 comments on commit 41a54d8

Please sign in to comment.