/*global security, properties, openidm */
/**
* This context population script is called when the managed user auth module was used
* to successfully authenticate a user
*
* global properties - auth module-specific properties from authentication.json for the
* managed user auth module
*
* {
* "propertyMapping": {
* "userRoles": "roles",
* "userCredential": "password",
* "userId": "_id"
* },
* "authnPopulateContextScript": "auth/managedPopulateContext.js",
* "defaultUserRoles": [ ]
* }
*
* global security - map of security context details as have been determined thus far
*
* {
* "authorization": {
* "id": "jsmith",
* "roles": [ "openidm-authorized" ]
* },
* "authenticationId": "jsmith",
* }
*/
(function () {
user;
throw {
"code" : 500,
"message" : "Authentication not properly configured; missing userRoles propertyMapping entry"
};
}
user = openidm.read(security.authorization.component + "/" + security.authorization.id, { }, [ "*", properties.propertyMapping.userRoles ]);
throw {
"code" : 401,
};
}
.filter(function (r) {
})
.map(function (r) {
// appending empty string gets the value from java into a format more familiar to JS
})
.value()
};
return security;
}());