use of org.wso2.carbon.identity.oauth.event.OAuthEventInterceptor in project identity-inbound-auth-oauth by wso2-extensions.
the class ResponseTypeHandlerUtil method triggerPostListeners.
public static void triggerPostListeners(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, AccessTokenDO tokenDO, OAuth2AuthorizeRespDTO respDTO) {
OAuthEventInterceptor oAuthEventInterceptorProxy = OAuthComponentServiceHolder.getInstance().getOAuthEventInterceptorProxy();
if (oAuthEventInterceptorProxy != null && oAuthEventInterceptorProxy.isEnabled()) {
try {
Map<String, Object> paramMap = new HashMap<>();
oAuthEventInterceptorProxy.onPostTokenIssue(oauthAuthzMsgCtx, tokenDO, respDTO, paramMap);
if (log.isDebugEnabled()) {
log.debug("Oauth post token issue listener is triggered.");
}
} catch (IdentityOAuth2Exception e) {
log.error("Oauth post token issue listener ", e);
}
}
}
use of org.wso2.carbon.identity.oauth.event.OAuthEventInterceptor in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuthAdminServiceImpl method triggerPreRevokeListeners.
void triggerPreRevokeListeners(OAuthRevocationRequestDTO revokeRequestDTO) throws IdentityOAuthAdminException {
OAuthEventInterceptor oAuthEventInterceptorProxy = OAuthComponentServiceHolder.getInstance().getOAuthEventInterceptorProxy();
if (oAuthEventInterceptorProxy != null && oAuthEventInterceptorProxy.isEnabled()) {
try {
Map<String, Object> paramMap = new HashMap<String, Object>();
oAuthEventInterceptorProxy.onPreTokenRevocationByResourceOwner(revokeRequestDTO, paramMap);
} catch (IdentityOAuth2Exception e) {
throw handleError("Error occurred with Oauth pre-revoke listener ", e);
}
}
}
Aggregations