AEM表单支持及时设置用户管理中尚不存在的用户。 借助即时设置,用户凭据成功通过身份验证后,将自动添加到用户管理中。 此外,相关角色和组会动态分配给新用户。
传统身份验证的工作方式如下:
当用户尝试登录AEM表单时,用户管理会按顺序将用户的凭据传递给所有可用的身份验证提供者。 (登录凭据包括用户名/密码组合、Kerberos票证、PKCS7签名等。)
身份验证提供程序验证凭据。
然后,身份验证提供程序检查用户是否存在于用户管理数据库中。 可能有以下结果:
存在:如 果用户当前并已解锁,则用户管理将返回身份验证成功。但是,如果用户不是当前用户或已锁定,则用户管理会返回身份验证失败。
不存在:用户 管理返回身份验证失败。
无效:用 户管理返回身份验证失败。
将评估身份验证提供程序返回的结果。 如果身份验证提供程序返回身份验证成功,则允许用户登录。 否则,用户管理会与下一个身份验证提供程序进行检查(步骤2-3)。
如果没有可用的身份验证提供程序验证用户凭据,则会返回身份验证失败。
当实现及时配置时,如果其中一个身份验证提供者验证用户的凭据,则在用户管理中动态创建新用户。 (在传统的验证过程中,步骤3之后,如上所示。)
AEM forms提供以下API以供及时配置:
package com.adobe.idp.um.spi.authentication ;
publ ic interface IdentityCreator {
/**
* Tries to create a user with the in formation provided in the <code>UserProvisioningBO</code> object.
* If the user is successfully created, a valid AuthResponse is returned along with the information using which the user was created.
* It is the responsibility of the IdentityCreator to set the User obje ct in the cre dential map with th e ke y <code>UMA u thenticationUtil.authenticatedUserKey</code>
* The credentials are available in the <code>UserProvisioningBO</code> object in the 'credentials' property.
* If the IdentityCreator is unable to create a user due to any reason, it returns <code>null</code>
* @param userBO An object of <code>com.adobe. i dp.um . spi.authenti c ationUserProvisioningBO</code>
* @return */public AuthResponse create(UserProvisioningBO userBO);
/**
* Returns the name of the IdentityCreator which will be registered in preferences.
* This name is used to associate the IdentityProvider with the Auth Provider Configuration in the domain.
* @return The name of the Identity Creator which is recognized in Configuration.
*/
public String getName();
}
package com.adobe.idp.um.spi.authentication;
import com.adobe.idp.um.api.infomodel.User;
public interface AssignmentProvider {
/**
* Tries to assign roles or permissions or group memberships to users created via Just-in-time provisioning.
* @param user The User created via the Just-in-time provisioning process.
* @return a Boolean flag indicating whether the assignment was successful or not.
*/
public Boolean assign(User user);
/**
* Returns the name of the AssignmentProvider through which it is registered under preferences.
* This name is used to associate the AssignmentProvider with the Auth Provider Configuration in the domain.
* @return The name of the AssignmentProvider which is recognized in Configuration.
*/public String getName();
}
IdentityCreator
时,请确保为本地用户指定虚拟口令。 请勿将此密码字段留空。DomainSpecificAuthentication
验证特定域的用户凭据。在“API for just-in-provisioning”部分编写实现API的DSC。
将DSC部署到表单服务器。
创建刚启用时间的域:
保存新域。
假定用户尝试登录AEM表单,且身份验证提供程序接受其用户凭据。 如果用户管理数据库中尚不存在该用户,则用户的身份检查将失败。 AEM表单现在可执行以下操作:
UserProvisioningBO
对象,并将其放在凭据映射中。UserProvisioningBO
返回的域信息,提取并调用已注册的IdentityCreator
和AssignmentProvider
作为域。IdentityCreator
。 如果它返回成功的AuthResponse
,请从凭据映射中提取UserInfo
。 将其传递给AssignmentProvider
以进行组/角色分配以及创建用户后进行的任何其他后处理。随附的是默认的IdentityCreator
设置功能,您可以使用它动态创建用户。 用户是使用与域中的目录关联的信息创建的。