Skip to Content.
Sympa Menu

mace-opensaml-users - Help : SAMLResponse generating SAXException

Subject: OpenSAML user discussion

List archive

Help : SAMLResponse generating SAXException


Chronological Thread 
  • From: Srinivas Padmanabhuni <>
  • To:
  • Subject: Help : SAMLResponse generating SAXException
  • Date: Thu, 15 May 2003 00:40:11 -0700 (PDT)


Hello

I am new to OpenSAML. Currently trying to use the POST
profile for single sign-on.
I have generated the SAML Response using the API. Then
took the output to a string and am passing it to a
second program to create a SAMLResponse. It throws as
SAXNotRecognizedException.

Details:
org.xml.sax.SAXNotRecognizedException:
http://apache.org/xml/features/validation/schema/normalized-v
alue
at
org.opensaml.SAMLObject.fromStream(SAMLObject.java:102)
at
org.opensaml.SAMLResponse.<init>(SAMLResponse.java:139)
at Test2.main(Test2.java:40)

Earlier tried to convert it to base64 and post it to
SAMLPostProfile and regenerate the SAMLResponse object
using the accept method. That was giving the same
exception as we are getting with this simple program
also. Any pointers will be helpful..
My listing follows:


import java.io.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import com.sun.xml.tree.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.security.Key;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.util.Arrays;
import java.util.Date;
import java.io.*;
import java.util.*;
import java.net.*;

import org.apache.log4j.Logger;
import org.apache.xml.security.signature.XMLSignature;
import org.opensaml.Init;
import org.opensaml.SAMLAssertion;
import org.opensaml.SAMLAttribute;
import org.opensaml.SAMLAttributeStatement;
import org.opensaml.SAMLAuthenticationStatement;
import org.opensaml.SAMLResponse;
import org.opensaml.SAMLStatement;
import org.opensaml.SAMLSubject;
import org.opensaml.XML;
import org.opensaml.SAMLPOSTProfile;
import org.apache.xerces.impl.dv.util.Base64;

class Test2
{
public static void main(String[] args)
{
try{
System.out.println("Hello World!");
String str="<Response
xmlns=\"urn:oasis:names:tc:SAML:1.0:protocol\"
xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\"
IssueInstant=\"2003-05-15T06:31:27Z\"
MajorVersion=\"1\" MinorVersion=\"0\"
ResponseID=\"3fbc2c40-4593-4835-bd1e-ce4932f1843c\"><Status><StatusCode
Value=\"samlp:Success\"></StatusCode></Status><Assertion
xmlns=\"urn:oasis:names:tc:SAML:1.0:assertion\"
AssertionID=\"6e8f81b6-6391-46db-8577-cfda7bc43174\"
IssueInstant=\"2003-05-15T06:31:32Z\" Issuer=\"Srini
P\" MajorVersion=\"1\" MinorVersion=\"0\"><Conditions
NotBefore=\"2003-05-15T06:31:27Z\"
NotOnOrAfter=\"2003-05-15T06:34:27Z\"></Conditions><AuthenticationStatement
AuthenticationInstant=\"2003-05-15T06:31:27Z\"
AuthenticationMethod=\"urn:oasis:names:tc:SAML:1.0:am:unspecified\"><Subject><NameIdentifier
Format=\"format\"
NameQualifier=\"nameQualifier\"></NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</ConfirmationMethod></SubjectConfirmation></Subject></AuthenticationStatement><AttributeStatement
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\";
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\";><Subject><NameIdentifier></NameIdentifier></Subject><Attribute
AttributeName=\"name\"
AttributeNamespace=\"namespace\"><AttributeValue>John
Doe</AttributeValue></Attribute></AttributeStatement></Assertion></Response>";
Init.init();
System.out.println(str+" ");
SAMLResponse samlResponse1=new SAMLResponse(new
ByteArrayInputStream(str.getBytes()));
}catch(Exception e) {e.printStackTrace();}
}
}


-Srinivas P









__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------mace-opensaml-users-+
For list utilities, archives, subscribe, unsubscribe, etc. please visit the
ListProc web interface at

http://archives.internet2.edu/

---------------------------------------------------mace-opensaml-users--




Archive powered by MHonArc 2.6.16.

Top of Page