diff --git a/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/config/IntentVerificationConfig.java b/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/config/IntentVerificationConfig.java index ad31f614f9f..15d1ba5bd4c 100644 --- a/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/config/IntentVerificationConfig.java +++ b/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/config/IntentVerificationConfig.java @@ -4,6 +4,8 @@ import java.util.HashMap; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.aop.support.AopUtils; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; @@ -31,6 +33,8 @@ public class IntentVerificationConfig implements ApplicationContextAware, Embedd private Map mappings = null; private StringValueResolver resolver = null; + private static final Logger logger = LoggerFactory.getLogger(IntentVerificationConfig.class); + @Override public void setEmbeddedValueResolver(StringValueResolver resolver) { this.resolver = resolver; @@ -38,6 +42,7 @@ public void setEmbeddedValueResolver(StringValueResolver resolver) { @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + logger.debug("inside setApplicationContext"); mappings = new HashMap<>(); for (String beanName : applicationContext.getBeanDefinitionNames()) { //Skip processing this intentVerificationConfig bean. @@ -47,19 +52,25 @@ public void setApplicationContext(ApplicationContext applicationContext) throws if (!((ConfigurableApplicationContext) applicationContext).getBeanFactory().getBeanDefinition(beanName) .isLazyInit()) { Object obj = applicationContext.getBean(beanName); + logger.debug("bean-"+ beanName); Class objClazz = obj.getClass(); + logger.debug("objClazz"+ objClazz); if (AopUtils.isAopProxy(obj)) { objClazz = AopUtils.getTargetClass(obj); } for (Method method : objClazz.getDeclaredMethods()) { + logger.debug("method name-"+method); if (method.isAnnotationPresent(PreAuthenticateContentAndVerifyIntent.class)) { PreAuthenticateContentAndVerifyIntent preAuthenticateContent = method .getAnnotation(PreAuthenticateContentAndVerifyIntent.class); String topic = preAuthenticateContent.topic(); + logger.debug("topic- "+topic); + String callback = preAuthenticateContent.callback(); + logger.debug("callback- "+callback); if (topic.startsWith("${") && topic.endsWith("}")) { topic = resolver.resolveStringValue(topic); } @@ -68,6 +79,7 @@ public void setApplicationContext(ApplicationContext applicationContext) throws callback = resolver.resolveStringValue(callback); } mappings.put(callback, topic); + logger.debug("mapping"+ mappings); } } IntentVerificationFilter intentVerificationFilter = applicationContext diff --git a/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/filter/IntentVerificationFilter.java b/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/filter/IntentVerificationFilter.java index 471ffa0e166..30d6e704c21 100644 --- a/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/filter/IntentVerificationFilter.java +++ b/kernel/kernel-websubclient-api/src/main/java/io/mosip/kernel/websub/api/filter/IntentVerificationFilter.java @@ -46,7 +46,9 @@ public IntentVerificationFilter(IntentVerifier intentVerifier) { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { + logger.debug("inside doFilterInternal"); + logger.debug("HttpServletRequest request- "+request); String topic=matchCallbackURL(request.getRequestURI()); if (request.getMethod().equals(HttpMethod.GET.name()) && topic!=null) { String topicReq = request.getParameter(WebSubClientConstants.HUB_TOPIC);