开发者

Marshalling error while using OPENSAML2 in a servlet environment (Tomcat web server)

I am trying to setup my S开发者_运维技巧ervice provider using OpenSAML2 libraries. I am trying to set up a servlet which would accept HttpRequest from user's browser and based on the request parameters I want to create a SAML Authentication request packet.

I am able to create the SAML packet, however I want to Base64 encode the SAML so that I can redirect the user browser to the Identity provider server. In order to do that I am trying to marshall the SAML Authentication Request using 'org.opensaml.saml2.core.impl.AuthnRequestMarshaller#marshall(AuthnRequest)'.

This works fine when I try it outside of the web server environment (standalone JAVA application). However when I run it as a servlet component I get an error saying "No marshaller available for {urn:oasis:names:tc:SAML:2.0:assertion}Issuer, child of {urn:oasis:names:tc:SAML:2.0:protocol}AuthnRequest", where Issuer is a component of the AuthnRequest object.

I am using Tomcat 5.5.34 webserver. It would be nice if someone can help me figure out whats happening here. It would help others trying to write their own Service Providers as well. Surprisingly very less documentation is available for this.

Thanks, Kaustubh


You need to have following jars inside Tomcat common/endorsed directory..

  • resolver-2.9.1.jar
  • serializer-2.9.1.jar
  • xalan-2.7.1.jar
  • xercesImpl-2.9.1.jar
  • xml-apis-2.9.1.jar

Here is an example of SAML2 service provider [also includes the sample WAR].


Prabath's answer is on the dot. I faced the same issue, and resolved it by endorsing xalan and xerces in the Sun iJDK. Check out the official guide from the Shibboleth site. Look under "Installing the Library" for openSAML deployment requirements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜