Search code examples
mobilefirst-server

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


I Want to test MFP adapter 8.0 using Postman

Steps followed -

  1. Registered the confidential client in MobileFirst Operations Console.
  2. Using Postman, Obtained access token from MobileFirst Server token endpoint.

I am able to get access token using url - /mfp/api/az/v1/token

  1. And used the access token received from MobileFirst Server token endpoint to make requests to the desired resources.

Now can I know how to store Login tokens in clientData and fetch tokens whenever required using -

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

Currently getting null pointer exception while getting clientId from clientData

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

Update : Attached snapshot of Request parameter passed for Token step https://i.sstatic.net/XVhLV.png


Solution

  • The observed behaviour is expected and by design.

    A confidential client does not have a clientId and no associated clientData.Client Data is populated only when using mobile SDK to do registration and subsequent operations.