Search in sources :

Example 1 with ConsentUtilityService

use of org.wso2.carbon.identity.consent.mgt.services.ConsentUtilityService in project carbon-identity-framework by wso2.

the class IdentityConsentServiceComponent method activate.

@Activate
protected void activate(ComponentContext ctxt) {
    try {
        ctxt.getBundleContext().registerService(AbstractEventHandler.class.getName(), new ConsentDeletionUserEventHandler(), null);
        ctxt.getBundleContext().registerService(ApplicationMgtListener.class.getName(), new ConsentDeletionAppMgtListener(), null);
        ctxt.getBundleContext().registerService(TenantMgtListener.class.getName(), new TenantConsentMgtListener(), null);
        ctxt.getBundleContext().registerService(ConsentUtilityService.class.getName(), new ConsentUtilityService(), null);
    } catch (Throwable throwable) {
        log.error("Error while activating Identity Consent Service Component.", throwable);
    }
}
Also used : TenantMgtListener(org.wso2.carbon.stratos.common.listeners.TenantMgtListener) TenantConsentMgtListener(org.wso2.carbon.identity.consent.mgt.listener.TenantConsentMgtListener) AbstractEventHandler(org.wso2.carbon.identity.event.handler.AbstractEventHandler) ConsentUtilityService(org.wso2.carbon.identity.consent.mgt.services.ConsentUtilityService) ApplicationMgtListener(org.wso2.carbon.identity.application.mgt.listener.ApplicationMgtListener) ConsentDeletionAppMgtListener(org.wso2.carbon.identity.consent.mgt.listener.ConsentDeletionAppMgtListener) ConsentDeletionUserEventHandler(org.wso2.carbon.identity.consent.mgt.handler.ConsentDeletionUserEventHandler) Activate(org.osgi.service.component.annotations.Activate)

Example 2 with ConsentUtilityService

use of org.wso2.carbon.identity.consent.mgt.services.ConsentUtilityService in project identity-governance by wso2-extensions.

the class UserSelfRegistrationManager method filterClaimsFromReceipt.

private void filterClaimsFromReceipt(ReceiptInput receiptInput, Map<String, String> claims) throws IdentityRecoveryServerException {
    ConsentUtilityService consentUtilityService = IdentityRecoveryServiceDataHolder.getInstance().getConsentUtilityService();
    try {
        Set<String> filteredKeys = consentUtilityService.filterPIIsFromReceipt(claims.keySet(), receiptInput);
        claims.keySet().retainAll(filteredKeys);
    } catch (ConsentUtilityServiceException e) {
        throw new IdentityRecoveryServerException("Receipt validation failed against purposes", e);
    }
}
Also used : ConsentUtilityServiceException(org.wso2.carbon.identity.consent.mgt.exceptions.ConsentUtilityServiceException) IdentityRecoveryServerException(org.wso2.carbon.identity.recovery.IdentityRecoveryServerException) ConsentUtilityService(org.wso2.carbon.identity.consent.mgt.services.ConsentUtilityService)

Aggregations

ConsentUtilityService (org.wso2.carbon.identity.consent.mgt.services.ConsentUtilityService)2 Activate (org.osgi.service.component.annotations.Activate)1 ApplicationMgtListener (org.wso2.carbon.identity.application.mgt.listener.ApplicationMgtListener)1 ConsentUtilityServiceException (org.wso2.carbon.identity.consent.mgt.exceptions.ConsentUtilityServiceException)1 ConsentDeletionUserEventHandler (org.wso2.carbon.identity.consent.mgt.handler.ConsentDeletionUserEventHandler)1 ConsentDeletionAppMgtListener (org.wso2.carbon.identity.consent.mgt.listener.ConsentDeletionAppMgtListener)1 TenantConsentMgtListener (org.wso2.carbon.identity.consent.mgt.listener.TenantConsentMgtListener)1 AbstractEventHandler (org.wso2.carbon.identity.event.handler.AbstractEventHandler)1 IdentityRecoveryServerException (org.wso2.carbon.identity.recovery.IdentityRecoveryServerException)1 TenantMgtListener (org.wso2.carbon.stratos.common.listeners.TenantMgtListener)1