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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
doPreauthRequest
(String zimbraUrl, String zimbraUser, String preAuthKey, CloseableHttpClient httpClient) Zimbra preauth request to log the current user into zimbra and retrieve the tokenvoid
service
(ServiceManager smanager)
-
Constructor Details
-
ZimbraPreauthHelper
public ZimbraPreauthHelper()
-
-
Method Details
-
service
- Specified by:
service
in 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
null
if user is null or has no email. - Throws:
MessagingConnectorException
- if failed to get zimbra token for user
-