Skip to content

Commit

Permalink
ZBUG-2858 add SOAP port to authentication context for use with Zimbra…
Browse files Browse the repository at this point in the history
…CustomAuth
  • Loading branch information
Barry de Graaff authored and silentsakky committed Oct 21, 2022
1 parent fb19f7b commit 00365db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions store/src/java/com/zimbra/cs/account/auth/AuthContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ public class AuthContext {
*/
public static final String AC_REMOTE_IP = "remoteip";

/*
* Port as seen from ZimbraSoapContext in:
* zm-mailbox/store/src/java/com/zimbra/cs/service/admin/Auth.java
* Present in context for SOAP (web-UI and SMTP authentication)
*
* To be used with ZimbraCustomAuth extensions to distinguish
* between SMTP and web-UI authentication.
*
* Example this is true for an SMTP auth request:
* if (context.get("soapport").equals(account.getServer().getMtaAuthPort()))
*
* type: Integer
*/
public static final String AC_SOAP_PORT = "soapport";

/*
* Account name passed in to the interface.
* Present in context for SOAP and http basic authentication.
Expand Down
1 change: 1 addition & 0 deletions store/src/java/com/zimbra/cs/service/account/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public Element handle(Element request, Map<String, Object> context) throws Servi
authCtxt.put(AuthContext.AC_REMOTE_IP, context.get(SoapEngine.SOAP_REQUEST_IP));
authCtxt.put(AuthContext.AC_ACCOUNT_NAME_PASSEDIN, acctValuePassedIn);
authCtxt.put(AuthContext.AC_USER_AGENT, zsc.getUserAgent());
authCtxt.put(AuthContext.AC_SOAP_PORT, zsc.getPort());

AuthMode mode = AuthMode.PASSWORD;
String code = password;
Expand Down

0 comments on commit 00365db

Please sign in to comment.