use of io.getlime.powerauth.soap.RemoveActivationResponse in project powerauth-restful-integration by lime-company.
the class ActivationController method removeActivation.
/**
* Get activation status.
* @param signatureHeader PowerAuth signature HTTP header.
* @return PowerAuth RESTful response with {@link ActivationRemoveResponse} payload.
* @throws PowerAuthActivationException In case activation access fails.
* @throws PowerAuthAuthenticationException In case the signature validation fails.
*/
@RequestMapping(value = "remove", method = RequestMethod.POST)
@ResponseBody
public ObjectResponse<ActivationRemoveResponse> removeActivation(@RequestHeader(value = PowerAuthSignatureHttpHeader.HEADER_NAME) String signatureHeader) throws PowerAuthActivationException, PowerAuthAuthenticationException {
try {
PowerAuthApiAuthentication apiAuthentication = authenticationProvider.validateRequestSignature("POST", null, "/pa/activation/remove", signatureHeader);
if (apiAuthentication != null && apiAuthentication.getActivationId() != null) {
RemoveActivationResponse soapResponse = powerAuthClient.removeActivation(apiAuthentication.getActivationId());
ActivationRemoveResponse response = new ActivationRemoveResponse();
response.setActivationId(soapResponse.getActivationId());
return new ObjectResponse<>(response);
} else {
throw new PowerAuthAuthenticationException("USER_NOT_AUTHENTICATED");
}
} catch (PowerAuthAuthenticationException ex) {
throw ex;
} catch (Exception ex) {
throw new PowerAuthActivationException();
}
}
Aggregations