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);
}
}
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;
}
Aggregations