Search in sources :

Example 1 with RevokeOAuthConsumerResponse

use of com.zimbra.soap.account.message.RevokeOAuthConsumerResponse in project zm-mailbox by Zimbra.

the class RevokeOAuthConsumer method handle.

@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
    ZimbraSoapContext zsc = getZimbraSoapContext(context);
    account = getRequestedAccount(zsc);
    RevokeOAuthConsumerRequest revokeRequest = JaxbUtil.elementToJaxb(request);
    accessTokenToBeRemoved = revokeRequest.getAccessToken();
    removeOAuthAccessor();
    removeAccessTokenFromForeignPrincipal();
    //Remove from cache
    OAuthTokenCache.remove(accessTokenToBeRemoved, OAuthTokenCache.ACCESS_TOKEN_TYPE);
    RevokeOAuthConsumerResponse response = new RevokeOAuthConsumerResponse();
    return zsc.jaxbToElement(response);
}
Also used : ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) RevokeOAuthConsumerRequest(com.zimbra.soap.account.message.RevokeOAuthConsumerRequest) RevokeOAuthConsumerResponse(com.zimbra.soap.account.message.RevokeOAuthConsumerResponse)

Aggregations

ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 RevokeOAuthConsumerRequest (com.zimbra.soap.account.message.RevokeOAuthConsumerRequest)1 RevokeOAuthConsumerResponse (com.zimbra.soap.account.message.RevokeOAuthConsumerResponse)1