I am trying to convert a rule that we have in use for applications with the wsfed addon:
function (user, context, callback) {
var roleProperty = ‘roles’;
if (user.hasOwnProperty(‘role’)) {
roleProperty = ‘role’;
}
context.samlConfiguration.mappings = {
‘http://schemas.microsoft.com/ws/2008/06/identity/claims/role’: roleProperty,
‘http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name’: ‘name’,
‘http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier’: ‘email’
};
callback(null, user, context);
}
Which works with no issue, I am trying to replace it with an action ahead of the deprecation with:
exports.onExecutePostLogin = async (event, api) => {
var roleProperty = ‘roles’;
if (event.user.hasOwnProperty(‘role’)) {
roleProperty = ‘role’;
}api.samlResponse.setAttribute(‘http://schemas.microsoft.com/ws/2008/06/identity/claims/role’,roleProperty);
api.samlResponse.setAttribute(‘http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name’,event.user.name );
api.samlResponse.setAttribute(‘http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier’,event.user.email );console.log(api.samlResponse)
};
but I get a http error 403, and the results of my console.log(api.samlResponse) in wetask logs is just:
Kc {}
Blockquote
The actual log itself in Auth0 is type Sucess Login.
I’m not sure what I’m doing wrong