Search in sources :

Example 1 with DCRProcessor

use of org.wso2.carbon.identity.oauth.dcr.processor.DCRProcessor in project identity-inbound-auth-oauth by wso2-extensions.

the class DCRServiceComponent method activate.

@SuppressWarnings("unused")
protected void activate(ComponentContext componentContext) {
    try {
        componentContext.getBundleContext().registerService(IdentityProcessor.class.getName(), new DCRProcessor(), null);
        componentContext.getBundleContext().registerService(HttpIdentityRequestFactory.class.getName(), new RegistrationRequestFactory(), null);
        componentContext.getBundleContext().registerService(HttpIdentityResponseFactory.class.getName(), new HttpRegistrationResponseFactory(), null);
        componentContext.getBundleContext().registerService(HttpIdentityRequestFactory.class.getName(), new UnregistrationRequestFactory(), null);
        componentContext.getBundleContext().registerService(HttpIdentityResponseFactory.class.getName(), new HttpUnregistrationResponseFactory(), null);
        componentContext.getBundleContext().registerService(RegistrationHandler.class.getName(), new RegistrationHandler(), null);
        componentContext.getBundleContext().registerService(UnRegistrationHandler.class.getName(), new UnRegistrationHandler(), null);
        componentContext.getBundleContext().registerService(DCRMService.class.getName(), new DCRMService(), null);
    } catch (Throwable e) {
        log.error("Error occurred while activating DCRServiceComponent", e);
    }
}
Also used : DCRMService(org.wso2.carbon.identity.oauth.dcr.service.DCRMService) HttpUnregistrationResponseFactory(org.wso2.carbon.identity.oauth.dcr.factory.HttpUnregistrationResponseFactory) UnRegistrationHandler(org.wso2.carbon.identity.oauth.dcr.handler.UnRegistrationHandler) UnregistrationRequestFactory(org.wso2.carbon.identity.oauth.dcr.factory.UnregistrationRequestFactory) RegistrationRequestFactory(org.wso2.carbon.identity.oauth.dcr.factory.RegistrationRequestFactory) HttpRegistrationResponseFactory(org.wso2.carbon.identity.oauth.dcr.factory.HttpRegistrationResponseFactory) IdentityProcessor(org.wso2.carbon.identity.application.authentication.framework.inbound.IdentityProcessor) RegistrationHandler(org.wso2.carbon.identity.oauth.dcr.handler.RegistrationHandler) UnRegistrationHandler(org.wso2.carbon.identity.oauth.dcr.handler.UnRegistrationHandler) DCRProcessor(org.wso2.carbon.identity.oauth.dcr.processor.DCRProcessor) HttpIdentityResponseFactory(org.wso2.carbon.identity.application.authentication.framework.inbound.HttpIdentityResponseFactory) HttpIdentityRequestFactory(org.wso2.carbon.identity.application.authentication.framework.inbound.HttpIdentityRequestFactory)

Example 2 with DCRProcessor

use of org.wso2.carbon.identity.oauth.dcr.processor.DCRProcessor in project identity-inbound-auth-oauth by wso2-extensions.

the class DCRProcessor method process.

@Override
public IdentityResponse.IdentityResponseBuilder process(IdentityRequest identityRequest) throws DCRException {
    if (log.isDebugEnabled()) {
        log.debug("Request processing started by DCRProcessor.");
    }
    DCRMessageContext dcrMessageContext = new DCRMessageContext(identityRequest);
    IdentityResponse.IdentityResponseBuilder identityResponseBuilder = null;
    if (identityRequest instanceof RegistrationRequest) {
        identityResponseBuilder = registerOAuthApplication(dcrMessageContext);
    } else if (identityRequest instanceof UnregistrationRequest) {
        identityResponseBuilder = unRegisterOAuthApplication(dcrMessageContext);
    }
    return identityResponseBuilder;
}
Also used : UnregistrationRequest(org.wso2.carbon.identity.oauth.dcr.model.UnregistrationRequest) IdentityResponse(org.wso2.carbon.identity.application.authentication.framework.inbound.IdentityResponse) DCRMessageContext(org.wso2.carbon.identity.oauth.dcr.context.DCRMessageContext) RegistrationRequest(org.wso2.carbon.identity.oauth.dcr.model.RegistrationRequest)

Aggregations

HttpIdentityRequestFactory (org.wso2.carbon.identity.application.authentication.framework.inbound.HttpIdentityRequestFactory)1 HttpIdentityResponseFactory (org.wso2.carbon.identity.application.authentication.framework.inbound.HttpIdentityResponseFactory)1 IdentityProcessor (org.wso2.carbon.identity.application.authentication.framework.inbound.IdentityProcessor)1 IdentityResponse (org.wso2.carbon.identity.application.authentication.framework.inbound.IdentityResponse)1 DCRMessageContext (org.wso2.carbon.identity.oauth.dcr.context.DCRMessageContext)1 HttpRegistrationResponseFactory (org.wso2.carbon.identity.oauth.dcr.factory.HttpRegistrationResponseFactory)1 HttpUnregistrationResponseFactory (org.wso2.carbon.identity.oauth.dcr.factory.HttpUnregistrationResponseFactory)1 RegistrationRequestFactory (org.wso2.carbon.identity.oauth.dcr.factory.RegistrationRequestFactory)1 UnregistrationRequestFactory (org.wso2.carbon.identity.oauth.dcr.factory.UnregistrationRequestFactory)1 RegistrationHandler (org.wso2.carbon.identity.oauth.dcr.handler.RegistrationHandler)1 UnRegistrationHandler (org.wso2.carbon.identity.oauth.dcr.handler.UnRegistrationHandler)1 RegistrationRequest (org.wso2.carbon.identity.oauth.dcr.model.RegistrationRequest)1 UnregistrationRequest (org.wso2.carbon.identity.oauth.dcr.model.UnregistrationRequest)1 DCRProcessor (org.wso2.carbon.identity.oauth.dcr.processor.DCRProcessor)1 DCRMService (org.wso2.carbon.identity.oauth.dcr.service.DCRMService)1