【发布时间】:2024-01-21 12:15:01
【问题描述】:
我正在构建一个 JAVA HTTP 适配器,我正在使用以下方法在 UserAuthenticationSecurityCheck 类中对用户进行身份验证
@Override
protected AuthenticatedUser createUser() {
return new AuthenticatedUser(userId, logonId, this.getName(), attributes);
}
@Override
protected boolean validateCredentials(Map<String, Object> credentials) {
return false;
}
在此控件转到 android 应用程序后,他们调用名为 /updateClientRegistrtion 的 REST API,该 API 将更新 ClientRegistrationData
@GET
public Response updateClientRegistartion(@Context HttpServletRequest request) {
AuthenticatedUser authUser = securityContext.getAuthenticatedUser();
Map<String, Object> attributes = authUser.getAttributes();
ClientData clientData = securityContext.getClientRegistrationData();
clientData.getProtectedAttributes().put(some parameter);
if (clientData.getClientId() != null) {
securityContext.storeClientRegistrationData(clientData);
}
但是这段代码给了我类似的错误
异常消息: 409; headers=[ MFP-Conflict=并发失败];身体={}
这个问题有什么解决办法吗?有人可以帮我解决这个问题。 教程如下:http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/user-authentication/security-check/
【问题讨论】:
标签: java jax-rs ibm-mobilefirst adapter