Results 1 to 3 of 3

Thread: Integrate Zimbra into 3rd-party portal

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    8

    Default Integrate Zimbra into 3rd-party portal

    Hi,

    i'm looking for a way to integrate zimbra with our portal. I need to show a page in our portal with the inbox of a user (i already figured the single sign on, it works), with the possibility to open an email and reply to / forward / etc it.

    If that isnt possible, is there a way to jump directly into an email, because i can list the mails of a user by reading directly from the imap server, but don't want to implement all the (very nicely done) functionality of replying (addressing) and forwarding.
    Regards,

    doubleju

  2. #2
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    21

    Default

    Hi Double,
    We'd be interested in hearing how you incorporated the SSO concept. This has been a topic of intrest for a while.

    In any case, there have been many ideas tossed around in regard to a welcome page.

    The one with the most weight behind it is the concept of a "welcome" page. (Search the bugzilla for that).

    I'd say vote for it. That will give you more of an idea of how you can create a welcome page for yourself.

    If it's not what you want, please by all means, file a bugzilla. We welcome our users ideas, and want to hear what you want.

    Thanks
    john

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    8

    Default

    Hi Tenor^^

    thanks for replying, i will look for the idea with the welcome-page later today.

    For the SSO, i followed this source.

    In order for preauth to be enabled for a domain, you need to run the
    zmprov command and create a key:
    prov> gdpak domain.com
    preAuthKey: 4e2816f16c44fab20ecdee39fb850c3b0bb54d03f1d8e073aa ea376a4f407f0c
    So i used
    /opt/zimbra/bin/zmprov zimbra-server.behind-our-portal.ext
    to generate our secret (referred as "generatedZimbraSecret" below) and implemented the following jsp:

    Code:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="de.our.company.sessionmanagement.*, java.io.*,java.text.*,java.util.*,java.security.*,javax.crypto.*" errorPage="" %><%!
      public static  String computePreAuth(Map<String,String> params, String key) 
      {
            TreeSet<String> names = new TreeSet<String>(params.keySet());
            StringBuilder sb = new StringBuilder();
            for (String name : names) {
                if (sb.length() > 0) sb.append('|');
                sb.append(params.get(name));
            }
            return getHmac(sb.toString(), key.getBytes()); 
        }
    
        private static String getHmac(String data, byte[] key) {
            try {
                ByteKey bk = new ByteKey(key);
                Mac mac = Mac.getInstance("HmacSHA1");
                mac.init(bk);
                return toHex(mac.doFinal(data.getBytes()));
            } catch (NoSuchAlgorithmException e) {
                throw new RuntimeException("fatal error", e);
            } catch (InvalidKeyException e) {
                throw new RuntimeException("fatal error", e);
            }
        }
        
        static class ByteKey implements SecretKey {
            private byte[] mKey;
            
            ByteKey(byte[] key) {
                mKey = (byte[]) key.clone();;
            }
            
            public byte[] getEncoded() {
                return mKey;
            }
    
            public String getAlgorithm() {
                return "HmacSHA1";
            }
    
            public String getFormat() {
                return "RAW";
            }       
       }
    
        public static String toHex(byte[] data) {
            StringBuilder sb = new StringBuilder(data.length * 2);
            for (int i=0; i<data.length; i++ ) {
               sb.append(hex[(data[i] & 0xf0) >>> 4]);
               sb.append(hex[data[i] & 0x0f] );
            }
    	return sb.toString();
        }
    
        private static final char[] hex = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' ,'8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f'};
    
    
    %><%
    	// *********************
      	// No Cache
      	response.addHeader("Pragma", "no-cache");
      	response.addHeader("Cache-Control", "no-cache");
      	response.addHeader("Cache-Control", "no-store");
      	response.addDateHeader("Expires", 0);
      
    	UserSession.check(request,response);
    	UserBean userBean=(UserBean)request.getAttribute("userBean");
    	String account=(String)userBean.get("mail");
    	String pwd=(String)userBean.get("userPassword");
    	String timestamp=""+System.currentTimeMillis();
    	HashMap<String,String> params = new HashMap<String,String>();
    	params.put("account", account);
    	params.put("by", "name"); // needs to be part of hmac
    	params.put("timestamp", timestamp);
    	params.put("expires", "0");
    	String key = "generatedZimbraSecret";
                                   
    	String preAuth=computePreAuth(params, key);
    	//     out.println(preAuth+"<br>");
    		 
    	String url="https://zimbra-server.behind-our-portal.ext/service/preauth?account="+account+"&expires=0&timestamp="+timestamp+"&preauth="+preAuth;
    	response.sendRedirect(url);
    	//	 out.println(url);
    %>
    Running this jsp in an iframe somehow works for us, but as zimbra takes a while to load it's not the optimal solution.

Similar Threads

  1. Replies: 26
    Last Post: 04-19-2011, 10:24 AM
  2. [SOLVED] Clamav problem ? What's happening ?
    By aNt1X in forum Installation
    Replies: 23
    Last Post: 02-14-2008, 05:43 AM
  3. svn version still won't start
    By kinaole in forum Developers
    Replies: 0
    Last Post: 10-04-2006, 07:47 AM
  4. Seeming variety of problems on suse-9.1
    By Crexis in forum Installation
    Replies: 52
    Last Post: 03-04-2006, 12:19 AM
  5. FC3 Install and no zimbra ?
    By aws in forum Installation
    Replies: 10
    Last Post: 10-09-2005, 05:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •