-
Notifications
You must be signed in to change notification settings - Fork 12
NotificationHandler
Zoltan Tarcsay edited this page Oct 10, 2015
·
3 revisions
Kind: global class
-
NotificationHandler
- new NotificationHandler([options])
-
.router :
express~Router
-
.logger :
winston~Logger
|Logger
- .sessionNotification(notificationSet)
Handles notifications
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options | |
[options.logger] |
winston~Logger | Logger
|
new Logger() |
Logger |
A express router for the notification receiver endpoint. It can be used as a middleware for your express application. It adds a single route: /agent/notifications which can be used to receive notifications from OpenAM. When a notification is received, its contents will be parsed and handled by one of the handler functions.
Kind: instance property of NotificationHandler
Example
var app = require('express')(),
agent = new (require('openam-agent').PolicyAgent)({...});
app.use(agent.notifications)
Logger
Kind: instance property of NotificationHandler
Parses notifications in a notification set and emits a 'session' event for each. CookieShield instances listen on this event to delete any destroyed cookies from the agent's session cache.
Kind: instance method of NotificationHandler
Emits: event:session
Param | Type | Description |
---|---|---|
notificationSet | object |
OpenAM notification set (parsed XML document) |
Example
app.use(agent.notifications.router);
agent.notifications.on('session', function (session) {
console.log('server - session changed: %s', JSON.stringify(session));
});