我正在使用 SAML v2 Reconcile lambda 从 ADFS 服务器映射角色:
function reconcile(user, registration, samlResponse) {
var roles = samlResponse.assertion.attributes['http://schemas.xmlsoap.org/claims/Group'] || [];
registration.roles = roles;
}
添加新角色时,代码似乎可以正常工作。用户注册被正确分配了角色。
但是,当我删除 AD 中的角色时,它不会反映在用户注册中。
在事件日志中,角色似乎已从注册中删除,但是当我在 UI 中查看用户时,它们保持不变。
8/26/2019 02:11:26 PM EEST Invoke configured lambda with Id [f9b358a9-63a2-4a28-b126-e70f9e0445f3]
8/26/2019 02:11:26 PM EEST User to reconcile:
{
"encryptionScheme" : null,
"factor" : null,
"id" : null,
"password" : null,
"passwordChangeRequired" : false,
"passwordLastUpdateInstant" : null,
"salt" : null,
"verified" : false,
"preferredLanguages" : [ ],
"memberships" : [ ],
"registrations" : [ {
"data" : { },
"preferredLanguages" : [ ],
"tokens" : { },
"applicationId" : "e6bc6d79-98b1-4a3b-8621-2a0a4dc9465c",
"authenticationToken" : null,
"cleanSpeakId" : null,
"id" : null,
"insertInstant" : null,
"lastLoginInstant" : null,
"roles" : [ ], <------------ roles are empty
"timezone" : null,
"username" : null,
"usernameStatus" : null,
"verified" : false
} ],
"active" : false,
"birthDate" : null,
"cleanSpeakId" : null,
"data" : { },
"email" : "johanad@xx",
"expiry" : null,
"firstName" : null,
"fullName" : null,
"imageUrl" : null,
"insertInstant" : null,
"lastLoginInstant" : null,
"lastName" : null,
"middleName" : null,
"mobilePhone" : null,
"parentEmail" : null,
"tenantId" : null,
"timezone" : null,
"twoFactorDelivery" : null,
"twoFactorEnabled" : false,
"twoFactorSecret" : null,
"username" : null,
"usernameStatus" : null
}
8/26/2019 02:11:26 PM EEST The user with the email address [johanad@xx] already exists.
8/26/2019 02:11:26 PM EEST Merge the reconciled user from the Identity Provider into the FusionAuth user.
8/26/2019 02:11:26 PM EEST User is already registered for application with Id [e6bc6d79-98b1-4a3b-8621-2a0a4dc9465c].
8/26/2019 02:11:26 PM EEST User has successfully been reconciled and logged into FusionAuth.