Please help get basics working

7 views
Skip to first unread message

Zakaluka

unread,
Dec 5, 2010, 1:22:00 AM12/5/10
to dyuproject
Hello Everyone,

I have been working for the last week to get dyuproject working and
have, so far, been unsuccessful. I am able to get Google's OpenID
implementation (Federated Login) working, but want to use something
that isn't tied to GAE. To try and find the problem, I created a
barebones verification servlet and corresponding web.xml entries to
prevent access to a certain page. I am trying to build this into the
default application that is created by the Eclipse plugin. However,
it doesn't look like it is working at all and I am not sure why. Any
help is greatly appreciated.

Relevant contents of web.xml:
========================================
<servlet>
<servlet-name>verify-servlet</servlet-name>
<servlet-class>zn.projects.zneve.server.VerifyServlet</servlet-
class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>verify-servlet</servlet-name>
<url-pattern>/verify</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>news.html</welcome-file>
</welcome-file-list>

<filter>
<filter-name>security-all</filter-name>
<filter-class>com.dyuproject.openid.OpenIdServletFilter</filter-
class>
<init-param>
<param-name>forwardUri</param-name>
<param-value>/news.html</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>security-all</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
========================================


Relevant contents of VerifyServlet.java
========================================
public class VerifyServlet extends HttpServlet {
final RelyingParty _relyingParty = RelyingParty.getInstance();

public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws IOException, ServletException {
doGet(request, response);
}

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
resp.setContentType("text/html");
req.getRequestDispatcher("/news.html").forward(req, resp);
return;
}
}
========================================

As you can see, all I am trying to do is force the Servlet to take me
to a login page no matter what. However, no matter how complex/simple
the variation I try or how I modify web.xml, when I click on the link
in news.html (to take me to mainpage.html), it goes through without
seemingly hitting the Servlet. Hopefully, someone can offer some
insight into what the problem is. If I should post the entire files,
please let me know.

Thank you in advance,

z.

David Yu

unread,
Dec 5, 2010, 6:20:03 AM12/5/10
to dyupr...@googlegroups.com
It would be better if you post the sample app.
Have you looked at the bare-bones servlet demo at modules/demos/openid-servlet ? 

Thank you in advance,

z.

--
You received this message because you are subscribed to the Google Groups "dyuproject" group.
To post to this group, send email to dyupr...@googlegroups.com.
To unsubscribe from this group, send email to dyuproject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dyuproject?hl=en.




--
When the cat is away, the mouse is alone.
- David Yu

Zakaluka

unread,
Dec 5, 2010, 7:35:38 PM12/5/10
to dyuproject
David,

Thanks for the quick reply. I've studied the demos extensively, but
they were initially too complicated for me (I've done a lot of plain
java programming, but never web-based stuff).

I finally figured it out the solution (at 3am). Apparently, the issue
was that I am using HTML files (not JSP) and HTML files are considered
static files by Google App Engine. GAE always serves static files,
regardless of what filters are applied to it. I was able to insert an
exclusion to appengine-web.xml for the specific HTML file I'm
protecting, which allowed the filter to work on it. Hopefully, the
rest of the OpenID integration will go more smoothly.

Regards,

z.

On Dec 5, 3:20 am, David Yu <david.yu....@gmail.com> wrote:
> On Sun, Dec 5, 2010 at 2:22 PM, Zakaluka <zakal...@gmail.com> wrote:
>
> It would be better if you post the sample app.
> Have you looked at the bare-bones servlet demo at
> modules/demos/openid-servlet ?
>
> > Thank you in advance,
>
> > z.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "dyuproject" group.
> > To post to this group, send email to dyupr...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > dyuproject+...@googlegroups.com<dyuproject%2Bunsubscribe@googlegrou ps.com>
> > .
Reply all
Reply to author
Forward
0 new messages