****专科毕业设计(专业外文翻译)
According to OpenId.net, Google, Wordpress, and other popular sites support OpenID.
If you've signed up for any of these sites you may already have an OpenID.
For instance, if you have a Yahoo! Account, you probably also have an OpenID (I did,
and didn't even know it). You just use your Yahoo! ID when you sign in, and Yahoo is your
OpenID Provider. You provide your Yahoo-based OpenID as whatever@yahoo.com and
the RP will ask Yahoo to authenticate you (you can actually see this in action if you run the
sample application that accompanies this article).
About the sample application
As I said at the beginning of this article, I've written a Java Web application that uses
openid4java to create a simple OpenID Relying Party (RP). It is a simple application that
you can build (as a WAR), drop into Tomcat, and run from your local machine. The sample
application has a very tight focus:
The user enters her OpenID on a registration page.
The application verifies the Identifier (by directing the user to her OP to sign in).
Upon successful authentication, the application retrieves the user's profile information
from the OP, and directs the user to a Save page where she can review and save her profile
information.
The information displayed on the Save page is pulled from the information available
from the OP.
I wrote the application with Wicket because, well, I really like Wicket. But I've tried to
minimize Wicket's "footprint" so that it doesn't distract you from learning how to write an
OpenID Relying Party.
The architecture of the sample application is divided into two areas of responsibility:
User interface written in Wicket
OpenID authentication — using the openid4java library
Of course the two areas intersect, but again, I have tried to keep overlap to a minimum
to make it easier to follow the OpenID instructions, rather than getting distracted by the
details of Wicket.
About openid4java and the sample application code
The OpenID Authentication spec is complicated. If you implement specifications all
the time, you'll probably be very comfortable writing your own implementation. As for me,
I'm lazy. I don't want to do any more work than I have to in order to solve the problem at
hand, which is where the openid4java library comes into play. openid4java is an
implementation of the OpenID Authentication specification that makes it much easier to use
OpenID programmatically.
The code listings that follow show the openid4java API calls an RP makes to use
OpenID. One thing you may notice is how little code the sample application actually needs
to make this happen. openid4java really does make your life easier.
To reduce the Wicket footprint in the sample application, I've isolated the code that
calls openid4java into its own Java class called RegistrationService (located in
com.makotogroup.sample.model). This class contains five methods that correspond to the
usage of the openid4java API:
4