/** * This API is used to verify and store consent input. * * @param receiptInput consent input. * @throws ConsentManagementException Consent Management Exception. */ public AddReceiptResponse addConsent(ReceiptInput receiptInput) throws ConsentManagementException { validateInputParameters(receiptInput); receiptInput.setConsentReceiptId(generateConsentReceiptId()); setAPIVersion(receiptInput); setPIIControllerInfo(receiptInput); getReceiptsDAO(receiptDAOs).addReceipt(receiptInput); if (log.isDebugEnabled()) { log.debug("Consent stored successfully with the Id: " + receiptInput.getConsentReceiptId()); } return new AddReceiptResponse(receiptInput.getConsentReceiptId(), receiptInput.getCollectionMethod(), receiptInput.getLanguage(), receiptInput.getPiiPrincipalId(), receiptInput.getTenantDomain()); }
private AddReceiptResponse addReceipt(String subject, String subjectTenantDomain, ServiceProvider serviceProvider, String spTenantDomain, List<ClaimMetaData> claims) throws SSOConsentServiceException { ReceiptInput receiptInput = buildReceiptInput(subject, serviceProvider, spTenantDomain, claims); AddReceiptResponse receiptResponse; try { startTenantFlowWithUser(subject, subjectTenantDomain); receiptResponse = getConsentManager().addConsent(receiptInput); } catch (ConsentManagementException e) { throw new SSOConsentServiceException("Consent receipt error", "Error while adding the consent " + "receipt", e); } finally { PrivilegedCarbonContext.endTenantFlow(); } if (isDebugEnabled()) { logDebug("Successfully added consent receipt: " + receiptResponse.getConsentReceiptId()); } return receiptResponse; }
private AddReceiptResponse addReceipt(String subject, String subjectTenantDomain, ServiceProvider serviceProvider, String spTenantDomain, List<ClaimMetaData> claims) throws SSOConsentServiceException { ReceiptInput receiptInput = buildReceiptInput(subject, serviceProvider, spTenantDomain, claims); AddReceiptResponse receiptResponse; try { startTenantFlowWithUser(subject, subjectTenantDomain); receiptResponse = getConsentManager().addConsent(receiptInput); } catch (ConsentManagementException e) { throw new SSOConsentServiceException("Consent receipt error", "Error while adding the consent " + "receipt", e); } finally { PrivilegedCarbonContext.endTenantFlow(); } if (isDebugEnabled()) { logDebug("Successfully added consent receipt: " + receiptResponse.getConsentReceiptId()); } return receiptResponse; }