Unparseable date in SAML Authentication for Zimbra FOSS edition

badrulnm
badrulnm used Ask the Experts™
on
Please guide me to solve this problem. I'm setting up Zimbra Collaboration Open Source as service provider (SP) and simplesamlphp as Identity Provider (IdP). I have installed samlextn.jar in /opt/zimbra/lib/ext/saml/ and configured SAML authentication for Zimbra server.

Zimbra server environment:

[zimbra@devzimbra ~]$ zmcontrol -v
Release 7.2.0_GA_2669.RHEL6_64_20120410002025 CentOS6_64 FOSS edition.
[zimbra@devzimbra ~]$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

The problem is after successfully authenticate in IdP and redirected to http://devzimbra/service/extension/samlreceiver, I'm getting this error in browser:

HTTP ERROR 500
Problem accessing /service/extension/samlreceiver. Reason:

    Unparseable date: "2018-12-13T09:48:09Z"



In /opt/zimbra/log/mailbox.log:
---------------------------
2018-12-14 10:51:31,149 INFO  [btpool0-13://devzimbra/service/extension/samlreceiver] [] extensions - Error in validating SAML response
java.text.ParseException: Unparseable date: "2018-12-14T02:51:14Z"
    at java.text.DateFormat.parse(DateFormat.java:337)
    at com.zimbra.cs.security.saml.SamlResponseHandler.validateSamlAssertion(SamlResponseHandler.java:231)
    at com.zimbra.cs.security.saml.SamlResponseHandler.validateSamlResponse(SamlResponseHandler.java:186)
    at com.zimbra.cs.security.saml.SamlResponseHandler.validateSamlResponse(SamlResponseHandler.java:145)
    at com.zimbra.cs.security.saml.SamlResponseHandler.handleSamlResponse(SamlResponseHandler.java:107)
    at com.zimbra.cs.security.saml.SamlResponseHandler.doPost(SamlResponseHandler.java:89)
    at com.zimbra.cs.extension.ExtensionDispatcherServlet.service(ExtensionDispatcherServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
    at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:422)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.DebugHandler.handle(DebugHandler.java:77)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:585)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:988)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:415)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:429)
    at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
2018-12-14 10:51:31,150 WARN  [btpool0-13://devzimbra/service/extension/samlreceiver] [] log - /service/extension/samlreceiver
javax.servlet.ServletException: Unparseable date: "2018-12-14T02:51:14Z"
    at com.zimbra.cs.security.saml.SamlResponseHandler.handleSamlResponse(SamlResponseHandler.java:127)
    at com.zimbra.cs.security.saml.SamlResponseHandler.doPost(SamlResponseHandler.java:89)
    at com.zimbra.cs.extension.ExtensionDispatcherServlet.service(ExtensionDispatcherServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
    at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:132)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:422)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.DebugHandler.handle(DebugHandler.java:77)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:585)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:988)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:415)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:429)
    at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2018

Commented:
Unparseable date: "2018-12-13T09:48:09Z"

The format of the date you receive back is not valid. Do you know what is the expected date format? Maybe there is a configuration that you can change the date format. If not you will have to get in touch with either Zimbra or simplesamlphp.
Top Expert 2016

Commented:
Odd that they wouldn't fall back to ISO format and find therefore that it would parse
Commented:
I think there is problem with saml extension for Zimbra (version 7.2). I've tested with current Zimbra (version 8.8.10) and no problem authenticating with SAML.

[zimbra@devzimbra2 ~]$ zmcontrol -v
Release 8.8.10_GA_3039.RHEL6_64_20180928094617 RHEL6_64 FOSS edition, Patch 8.8.10_P4.
[zimbra@devzimbra2 ~]$ java -version
openjdk version "1.8.0_172-zimbra"
OpenJDK Runtime Environment (build 1.8.0_172-zimbra-b01)
OpenJDK 64-Bit Server VM (build 25.172-b01, mixed mode)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial