use of io.getlime.security.powerauth.rest.api.model.response.v3.ActivationStatusResponse in project powerauth-restful-integration by lime-company.
the class ActivationService method getActivationStatus.
/**
* Get activation status.
*
* @param request Activation status request.
* @return Activation status response.
* @throws PowerAuthActivationException In case retrieving activation status fails.
*/
public ActivationStatusResponse getActivationStatus(ActivationStatusRequest request) throws PowerAuthActivationException {
try {
final String activationId = request.getActivationId();
final String challenge = request.getChallenge();
final GetActivationStatusResponse paResponse = powerAuthClient.getActivationStatusWithEncryptedStatusBlob(activationId, challenge);
final ActivationStatusResponse response = new ActivationStatusResponse();
response.setActivationId(paResponse.getActivationId());
response.setEncryptedStatusBlob(paResponse.getEncryptedStatusBlob());
response.setNonce(paResponse.getEncryptedStatusBlobNonce());
if (applicationConfiguration != null) {
final ActivationContext activationContext = activationContextConverter.fromActivationDetailResponse(paResponse);
response.setCustomObject(applicationConfiguration.statusServiceCustomObject(activationContext));
}
return response;
} catch (Exception ex) {
logger.warn("PowerAuth activation status check failed, error: {}", ex.getMessage());
logger.debug(ex.getMessage(), ex);
throw new PowerAuthActivationException();
}
}
Aggregations