[Shib-Users] Lots of "Unable to redirect to login page" errors on IdP

182 views
Skip to first unread message

Etienne Dysli

unread,
Jun 29, 2010, 9:31:42 AM6/29/10
to shibbole...@internet2.edu
Hello everyone!

Since running a version 2 IdP, I see lots of "Unable to redirect to
login page" errors in the log, caused by a NullPointerException.
Approximately 200 of these occur every day (sometimes as much as 400),
yet I haven't heard users complain about this. I don't know what the
browser display looks like because I've never managed to reproduce it.

Here is an example from the logs:

2010-06-29 14:46:52,845 - ERROR
[edu.internet2.middleware.shibboleth.idp.authn.provider.UsernamePasswordLoginServlet:143]
- Unable to redirect to login page.
org.apache.jasper.JasperException: java.lang.NullPointerException
at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
[jasper.jar:6.0.26]
[...]
Caused by: java.lang.NullPointerException: null
at org.apache.jsp.login_jsp._jspService(login_jsp.java:270) [na:na]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
[jasper.jar:6.0.26]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[servlet-api.jar:na]
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
[jasper.jar:6.0.26]
... 30 common frames omitted

Previous log lines don't seem to indicate another error condition nor
display the same pattern for each occurence. Line 270 of file
tomcat/work/Catalina/localhost/idp/org/apache/jsp/login_jsp.java is:

out.print( loginContext.getRequestedAuthenticationMethods() );

So is LoginContext.getRequestedAuthenticationMethods() really the
culprit for throwing that NPE? Looking quickly at its code, that seems
unlikely. Do you have any other ideas? What user behaviour could trigger
this error?

Regards,
Etienne

signature.asc

Chad La Joie

unread,
Jun 29, 2010, 9:47:50 AM6/29/10
to shibbole...@internet2.edu
Can you see the IP addresses in the access log? Most likely what has
happened is that some people book marked the login page and they end up
going to that first. The NPE would then be caused because the
loginContext object was null.

--
Chad La Joie
http://itumi.biz
trusted identities, delivered

Peter Schober

unread,
Jun 29, 2010, 10:21:24 AM6/29/10
to shibbole...@internet2.edu
* Etienne Dysli <etienn...@unil.ch> [2010-06-29 15:32]:

> Since running a version 2 IdP, I see lots of "Unable to redirect to
> login page" errors in the log, caused by a NullPointerException.
> Approximately 200 of these occur every day (sometimes as much as 400),
> yet I haven't heard users complain about this. I don't know what the
> browser display looks like because I've never managed to reproduce it.

By checking for an empty login context in login.jsp you can avoid
those, as has been suggested on this list, incl code a example.
Here's a login.jsp skeleton, but you can dig up the original in the
archives (the import statement is that way to avoid spurious line
breaks in the generated HTML output):

<%@ page
import="edu.internet2.middleware.shibboleth.idp.authn.LoginContext,
edu.internet2.middleware.shibboleth.idp.session.*,
edu.internet2.middleware.shibboleth.idp.util.HttpServletHelper" %><%
LoginContext loginContext = HttpServletHelper.getLoginContext(HttpServletHelper.getStorageService(application), application, request);
Session userSession = HttpServletHelper.getUserSession(request);
%><?xml ...><!DOCTYPE ...><html ...>

<% if(loginContext != null){ %>
<% if ("true".equals(request.getAttribute("loginFailed"))) { %>
<h1>Authentication failed</h1>
<% } else { %>
<h1>Login</h1>
<% } %>
<% } else { %>
<h1>Error</h1>
<% } %>

cheers,
-peter

Etienne Dysli

unread,
Jun 29, 2010, 10:45:24 AM6/29/10
to shibbole...@internet2.edu
Chad La Joie wrote:
> Can you see the IP addresses in the access log?

Not in idp-access.log because accesses to /idp/Authn/UserPassword aren't
logged there but I can look it up in Apache's log with the timestamp.

> Most likely what has happened is that some people book marked the
> login page and they end up going to that first. The NPE would then
> be caused because the loginContext object was null.

Indeed directly accessing /idp/Authn/UserPassword triggers this error.
Moreover loginContext.getRequestedAuthenticationMethods() is the first
method call on loginContext in my login.jsp so this looks logical.

But I see (in Apache's log) three times more GET requests without
referrer on /idp/Authn/UserPassword than there are errors. So something
else than just bookmarks is causing these requests and not all of them
lead to an error. Unfortunately, the HTTP response code is always 200
thus I cannot distinguish errors in Apache's access log.

Regards,
Etienne

signature.asc

Etienne Dysli

unread,
Jul 2, 2010, 2:48:19 AM7/2/10
to shibbole...@internet2.edu
Peter Schober wrote:
> By checking for an empty login context in login.jsp you can avoid
> those, as has been suggested on this list, incl code a example.

Thanks Peter! :) I'll try this out.

Regards,
Etienne

signature.asc

suresh kumar

unread,
Jul 2, 2010, 9:17:54 AM7/2/10
to shibbole...@internet2.edu

Hi,

     I am creating one web application in .net  . In which I need to integrate shibboleth idp ? shibboleth idp is already installed and setup in a separate server ( ubuntu server,apache).

    How will I configure shibboleth into my website to authenticate user ?

    How will sync users in both my website and shibboleth idp server ?

Can anyone give some reference links to work on this ? Also I need to enable single sign on to this shibboleth server ?

    If any one send some sample application then it will be more useful for me. What I need to do to work on the above ?

    Looking forward your response.

Thanks,

Suresh.

Chad La Joie

unread,
Jul 2, 2010, 9:53:35 AM7/2/10
to shibbole...@internet2.edu
If you are not contributing to a thread do not reply to it. Start a new
email. Also, before asking questions like this read the Shibboleth
documentation.

--

Peter Schober

unread,
Jul 2, 2010, 9:59:36 AM7/2/10
to shibbole...@internet2.edu
Don't just reply to any email from the list unless you intend to
contribute to that specific thread. Instead, compose a new email to
the list address with a meaningful subject.

* suresh kumar <ksure...@gmail.com> [2010-07-02 15:18]:


> I am creating one web application in .net . In which I need to
> integrate shibboleth idp ? shibboleth idp is already installed and
> setup in a separate server ( ubuntu server,apache).

See the middle column "Native Service Provider (SP)" of
https://spaces.internet2.edu/display/SHIB2/Configuration

> How will I configure shibboleth into my website to authenticate
> user?

See above.

> How will sync users in both my website and shibboleth idp server?

You might want to have a look at these:
https://spaces.internet2.edu/display/SHIB2/UnderstandingShibboleth
https://spaces.internet2.edu/display/SHIB2/FlowsAndConfig

-peter

suresh kumar

unread,
Jul 2, 2010, 10:26:47 AM7/2/10
to shibbole...@internet2.edu
Sorry.. I apologize for this.

Thanks & Regards,
Sureshk.
Reply all
Reply to author
Forward
0 new messages