将非移动用户登录令牌存储在 clientData 中,并在 mobilefirst 需要时获取令牌

store non- mobile user Login tokens in clientData and fetch tokens whenever required in mobilefirst

我想使用 Postman 测试 MFP 适配器 8.0

遵循的步骤 -

  1. 已在 MobileFirst Operations Console 中注册机密客户端。
  2. 使用 Postman,从 MobileFirst Server 令牌端点获取访问令牌。

我可以使用 url - /mfp/api/az/v1/token

获取访问令牌
  1. 并使用从 MobileFirst Server 令牌端点接收到的访问令牌向所需资源发出请求。

现在我可以知道如何在 clientData 中存储登录令牌并在需要时使用 -

获取令牌

clientData.getProtectedAttributes().get("");

当前从clientData获取clientId时出现空指针异常

String clientId = (String) clientData.getProtectedAttributes().get("clientId");

更新:为令牌步骤传递的请求参数的附加快照 https://i.stack.imgur.com/XVhLV.png

观察到的行为是设计使然。

机密客户端没有clientId,也没有关联clientData.Client只有在使用移动SDK进行注册和后续操作时才会填充数据。