The basic authentication methods do not provide access to the
PeopleToken that is created for the initial authentication. Instead, the relevant values are stored in an
AuthenticationResult object in the
WWClient. However, there may be scenarios where you want to store the PeopleToken in a database or long-term cache. To do this, additional methods have been added to the
WWauthenticationEndpoint.authorizeUserGetToken(String basicAuthApp, String userToken, String url)allows you to perform an initial authentication with the user's token and return the PeopleToken.
WWAuthenticationEndpoint.authorizeUserRefreshTokenGetToken(String basicAuthApp, String refreshToken, String scope)allows you to re-authenticate with the refreshToken and return the PeopleToken.
If you are storing the PeopleToken somewhere, ensure you properly encrypt the token because it will include all credentials required to run as the user and re-authenticate when the token expires.
You need to pass the Base64 encoded application credentials to the method. The easiest way to do that is to pass the appId and appSecret to a WWClient object and use the
getAppCredentials() method. You can then pass those credentials, the initial user token and the scope to use.
If you're storing the token, you will need to manually refresh and get the updated PeopleToken when it's due to expire.