Skip to Content.
Sympa Menu

shibboleth-dev - Re: getting the REMOTE_USER header

Subject: Shibboleth Developers

List archive

Re: getting the REMOTE_USER header


Chronological Thread 
  • From: Chad La Joie <>
  • To:
  • Subject: Re: getting the REMOTE_USER header
  • Date: Sat, 15 Apr 2006 21:10:22 -0400

Upgrade to Xerces 2.8 or turn of deferred DOM (it's a parser "feature").

Tom Scavo wrote:
In a servlet, I'm trying to replicate this chunk of code from
ShibbolethV1SSOHandler.java:

String username =
support.getIdPConfig().getAuthHeaderName().equalsIgnoreCase("REMOTE_USER")
?
request.getRemoteUser() :
request.getHeader(support.getIdPConfig().getAuthHeaderName());

I don't have access to an IdPProtocolSupport object, so I tried the following:

IdPConfig idpConfig =
new IdPConfig((Element)
IdPConfigLoader.getIdPConfig(getServletContext()));
String authHeaderName = idpConfig.getAuthHeaderName();
String username =
authHeaderName.equalsIgnoreCase("REMOTE_USER") ?
request.getRemoteUser() : request.getHeader(authHeaderName);

But when I request the servlet, I get this runtime error:

java.lang.ClassCastException:
com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl

edu.internet2.middleware.shibboleth.idp.CertificateRegistry.init(CertificateRegistry.java:95)
javax.servlet.GenericServlet.init(GenericServlet.java:211)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)

Any suggestions or ideas?

Thanks,
Tom

--
Chad La Joie 2052-C Harris Bldg
OIS-Middleware 202.687.0124



Archive powered by MHonArc 2.6.16.

Top of Page