Hi Ishara. 

You can use this code[1] for IS 4.1.0. 

If you want to use it for IS 4.0.0 you need to change this line:
samlObject = Util.unmarshall(Util.decode(samlResp)) and remove the call to
Util.decode method  because the saml response was not encode in IS 4.0.0. 

I hope this help you.

[1] http://svn.wso2.org/repos/wso2/people/asela/wso2-samples/sso_webapp/ 


Saludos,
Ing. Jorge Infante Osorio.
CDAE.
Fac. 5.
UCI.
“En un mundo perfecto las pizzas serían una comida saludable, las laptops se
cargarían desde una fuente de corriente inalámbrica y todos los JAR serían
bundles de OSGI ”

De: [email protected] [mailto:[email protected]] En nombre de Ishara
Premadasa
Enviado el: miércoles, 08 de mayo de 2013 0:24
Para: WSO2 Developers' List
Asunto: [Dev] Fwd: SAML2 Web Browser based SSO with WSO2 IS demo webapp
doesn't work with IS 4.1.0

Hi,
Forwarding this to dev-group as this should be sent there. Sorry for the
mistake. 
-Ishara

---------- Forwarded message ----------
From: Ishara Premadasa <[email protected]>
Date: Wed, May 8, 2013 at 9:49 AM
Subject: [Dev] SAML2 Web Browser based SSO with WSO2 IS demo webapp doesn't
work with IS 4.1.0
To: support-dev-group <[email protected]>

Hi, 


I was testing SSO with WSO2 IS as described in [1] and it seems the demo web
app doesn't work as expected with IS 4.1.0 version. When i try to log in to
Identity Server via the webapp, after entering the credentials and  trying
to sign in it throws the following error. 
java.lang.NullPointerException
        
org.wso2.identity.saml2.demo.SamlConsumerManager.getResult(SamlConsumerManag
er.java:278)
        
org.wso2.identity.saml2.demo.SamlConsumerManager.processResponseMessage(Saml
ConsumerManager.java:252)
        
org.wso2.identity.saml2.demo.SAML2ConsumerServlet.doPost(SAML2ConsumerServle
t.java:77)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.39 logs.

I debugged the source and this is given as the reason for the exception.

[Fatal Error] :1:1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
    at
org.wso2.identity.saml2.demo.SamlConsumerManager.unmarshall(SamlConsumerMana
ger.java:265)
    at
org.wso2.identity.saml2.demo.SamlConsumerManager.processResponseMessage(Saml
ConsumerManager.java:238)
    at
org.wso2.identity.saml2.demo.SAML2ConsumerServlet.doPost(SAML2ConsumerServle
t.java:77)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at 

The webapp works fine as expected with the IS 3.2.3 version. May be this is
due to some changes made in the 4.1.0 version.
Thanks!
Ishara

[1]
http://wso2.org/library/articles/2010/07/saml2-web-browser-based-sso-wso2-id
entity-server


-- 
Ishara Premasada
Software Engineer,
Integration Technology Team,
WSO2 Inc. http://wso2.com/
Linked in   :  http://www.linkedin.com/pub/ishara-premadasa/1a/630/609
Twitter       :  https://twitter.com/ishadil
Mobile       : +94 714445832




-- 
Ishara Premasada
Software Engineer,
Integration Technology Team,
WSO2 Inc. http://wso2.com/
Linked in   :  http://www.linkedin.com/pub/ishara-premadasa/1a/630/609
Twitter       :  https://twitter.com/ishadil
Mobile       : +94 714445832


http://www.uci.cu
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to