/** * Extract information related to the token introspection and publish the event on introspection error. * * @param */ public static void triggerOnIntrospectionExceptionListeners(OAuth2TokenValidationRequestDTO introspectionRequest, OAuth2IntrospectionResponseDTO introspectionResponse) { Map<String, Object> params = new HashMap<>(); params.put("error", introspectionResponse.getError()); try { OAuthEventInterceptor oAuthEventInterceptorProxy = OAuthComponentServiceHolder.getInstance() .getOAuthEventInterceptorProxy(); if (oAuthEventInterceptorProxy != null) { try { oAuthEventInterceptorProxy.onTokenValidationException(introspectionRequest, params); } catch (IdentityOAuth2Exception e) { log.error("Error while invoking OAuthEventInterceptor for onTokenValidationException", e); } } } catch (Throwable e) { // Catching a throwable as we do no need to interrupt the code flow since these are logging purposes. if (log.isDebugEnabled()) { log.debug("Error occurred while executing oAuthEventInterceptorProxy for onTokenValidationException.", e); } } }