Hi,
My SSO java code started failing intermittently with an exception of the
type 'Unexpected end of ZLIB input stream'  when decoding the SAML request. 
Has anybody gone through this before?
Here is my code for decoding, based on the original reference
implementation, and somewhat modified based on suggestions in this list from
some time ago (by Nate) as to how to avoid intermittent exceptions related
to buffer size:
 
=======================================================================
 
private String decodeAuthnRequestXML(String encodedRequestXmlString) throws
SamlException {

    String uncompressed = null; 

    try {

    // URL decode

    // No need to URL decode: auto decoded by request.getParameter() method

    // Base64 decode

    Base64 base64Decoder = new Base64();

    byte[] xmlBytes = encodedRequestXmlString.getBytes("UTF-8");

    byte[] base64DecodedByteArray = base64Decoder.decode(xmlBytes);

    // Uncompress the AuthnRequest data using a stream decompressor, as
suggested by Nate ( Google Apps Api's group)

    try {

    uncompressed = new String(inflate(base64DecodedByteArray, true)); 

    } catch (ZipException e) {

    uncompressed = new String(inflate(base64DecodedByteArray, false));

    }

    } catch (UnsupportedEncodingException e) {

    e.printStackTrace();

    throw new SamlException("Error decoding AuthnRequest: " +

    "Check decoding scheme - " + e.getMessage());

    } catch (Exception e) {

    e.printStackTrace();

    throw new SamlException("Error decoding AuthnRequest: " +

    "Check decoding scheme - " + e.getMessage());

    }

    return uncompressed; 

}

============================================================================
======================

I'll appreciate any ideas/suggestions you may have. Thanks,

-Patricia

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to