Search in sources :

Example 1 with AddReceiptResponse

use of org.wso2.carbon.consent.mgt.core.model.AddReceiptResponse in project carbon-identity-framework by wso2.

the class SSOConsentServiceImpl method addReceipt.

private void addReceipt(String subject, String subjectTenantDomain, ServiceProvider serviceProvider, String spTenantDomain, List<ClaimMetaData> claimsWithConsent, List<ClaimMetaData> claimsDeniedConsent) throws SSOConsentServiceException {
    ReceiptInput receiptInput = buildReceiptInput(subject, serviceProvider, spTenantDomain, claimsWithConsent, claimsDeniedConsent);
    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());
    }
}
Also used : AddReceiptResponse(org.wso2.carbon.consent.mgt.core.model.AddReceiptResponse) ReceiptInput(org.wso2.carbon.consent.mgt.core.model.ReceiptInput) ConsentManagementException(org.wso2.carbon.consent.mgt.core.exception.ConsentManagementException) SSOConsentServiceException(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.exception.SSOConsentServiceException)

Aggregations

ConsentManagementException (org.wso2.carbon.consent.mgt.core.exception.ConsentManagementException)1 AddReceiptResponse (org.wso2.carbon.consent.mgt.core.model.AddReceiptResponse)1 ReceiptInput (org.wso2.carbon.consent.mgt.core.model.ReceiptInput)1 SSOConsentServiceException (org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.exception.SSOConsentServiceException)1