Get an access token
Overview
During Tokenization, the NFC Wallet SDK sets up a secure channel with the NFC Wallet backend when you Trigger provisioning.
The SDK uses this secure channel to issue an access token for:
digital card LCM
transaction notifications
Access tokens expire. Refresh them when needed.
SDK integration
Use ProvisioningBusinessService and the digital card ID to retrieve an access token.
Implement AccessTokenListener to receive the token in onSuccess(...).
Treat access tokens as sensitive data.
Do not log them or persist them to disk.
public void getAccessToken(final String digitalCardId) {
final ProvisioningBusinessService provisioningService =
ProvisioningServiceManager.getProvisioningBusinessService();
provisioningService.getAccessToken(
digitalCardId,
GetAccessTokenMode.REFRESH,
new AccessTokenListener() {
@Override
public void onSuccess(final String digitalCardId, final String accessToken) {
// Token successfully retrieved.
// Use it to call LCM services and retrieve transaction notifications.
}
@Override
public void onError(final String digitalCardId, final ProvisioningServiceError error) {
// Handle errors (for example, no data connection).
}
}
);
}Last updated
Was this helpful?