Package org.ametys.plugins.zimbra
Class ZimbraPreauthHelper
java.lang.Object
org.ametys.plugins.zimbra.ZimbraPreauthHelper
- All Implemented Interfaces:
 Serviceable
Helper for Zimbra SOAP authentication, according to https://wiki.zimbra.com/wiki/Preauth
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringdoPreauthRequest(String zimbraUrl, String zimbraUser, String preAuthKey, CloseableHttpClient httpClient) Zimbra preauth request to log the current user into zimbra and retrieve the tokenvoidservice(ServiceManager smanager)  
- 
Constructor Details
- 
ZimbraPreauthHelper
public ZimbraPreauthHelper() 
 - 
 - 
Method Details
- 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
doPreauthRequest
public static String doPreauthRequest(String zimbraUrl, String zimbraUser, String preAuthKey, CloseableHttpClient httpClient) Zimbra preauth request to log the current user into zimbra and retrieve the token- Parameters:
 zimbraUrl- the url of zimbrazimbraUser- the userpreAuthKey- the pre-auth key, computed with user, a timestamp and the secret keyhttpClient- The http client- Returns:
 - The Zimbra token which can be used in future request made through the Zimbra REST API or 
nullif user is null or has no email. - Throws:
 MessagingConnectorException- if failed to get zimbra token for user
 
 -