Steffo's EcholotOnly technical stuff here. |
|
Monday Sep 24, 2007
OpenSSO with OpenID (on the Mac featuring Glassfish)
I've been asked for this a couple of times. Building and getting the OpenID extension for OpenSSO running
I assume that you have already downloaded and deployed OpenSSO in the Glassfish application server. Also, you must be able to successfully login to OpenSSO's console as 'amadmin'. Overall Scenario We will setup 4 (HTTP) services:
The 4 components correspond to the ones used by Sun's deployment (as described in Hubert's blog: the relying party (Python client), the OpenID Identifier Server (Apache), OpenID Extension (OpenID Endpoint at 18080), Login (OpenSSO server at 8080). There is no registration component in our example. Users are either created from the OpenSSO console or privioned to an LDAP data source. Step 1. Download and build the OpenID extension First, login to OpenSSO's console and create an account to be used by the OpenID extension (the OpenID extension is an OpenSSO client which tries to authenticate against the OpenSSO server).
Second, checkout the OpenSSO source code via cvs -d :pserver:yourlogin@cvs.dev.java.net:/cvs checkout opensso an save the result in e.g. ~/Projects/OpenSSO/src. Next, dowload the OpenSSO ClientSDK and save the JAR famclientsdk.jar in e.g. ~/Projects/OpenSSO/clientSDK/. The client SDK is needed by the OpenID extension. The OpenID extension is at: opensso/extensions/openid/provider/ in the OpenSSO source tree. You'll also find a build.xml with all the necessary targets there. Now copy the following JARs to opensso/extensions/openid/provider/extlib:
Setup a NetBeans project; I used 'Java Project with existing Ant script'. Make sure you add the above JARs to your NetBeans project. There are two properties files which are crucial
More information can be found the extension's README
AMConfig.properties contains configuration information required by the OpenSSO client SDK (do not mix up this one up with the OpenSSO server configuration file which has the same name but resides somewhere at /etc/OpenSSO or /etc/SUNWam - you've been asked for the exact location during the OpenSSO installation). Make sure that everything in this file is correct. Also check that the debug directity exists and that the naming URL is correct. Here are the keys that work for my setup:
Make sure, that in your setup, the values of the server's and client's AMConfig.properties match. Provider.properties There are only a few keys here.
You can now build the OpenID extension by selecting the target 'war'. I deployed the 'provider.jar' at http://teufelchen.nit8.net:18080/openid. Browse to http://teufelchen.nit8.net:18080/openid and you should see the service end point. Step 2. Configuring your OpenID URL and create a user in OpenSSO The OpenID URL I want to use is: "http://teufelchen.init8.net/steffo". Browsing to this URL should retrieve the document at $DOCROOT/steffo/index.html. I used Apache's standard 'index.html' (the one that gives you the 'Seeing this instead of the website you expected?') and pasted the following between th HEAD tag: <link rel="openid.server" href="http://teufelchen.init8.net:18080/openid/service"/> You also have to create a user in OpenSSO. The ID of that user depends on the OpenID you want to use. If you want to use "http://teufelchen.init8.net/steffo", create a user "steffo". Note that this user might reside in an external LDAP (in which case you have to configure an appropriate authentication module and data source - but that's not required for this sample). Step 3. Download and install the OpenID client Download the Python libs at http://www.openidenabled.com/ . Follow the installation instructions and edit the file 'consumer.py' in the examples directory. Modify the following keys:
You can now start the consumer from the command shell: python consumer.py --port 8001 This sets up an HTTP service. The above command outputs something like:
Server running at:
I put a fake entry to /etc/hosts which assigns 127.0.0.1 the name "openid.init8.net". Direct your browser to this URL. You can now enter your OpenID (e.g. http://teufelchen.init8.net/steffo) into the box. Next, you'll be redirected to OPenSSO's login screen. After successfully entering your credential, you'll see a message like The website http://openid.init8.net:8001/ is requesting confirmation that your OpenID identity is http://teufelchen.init8.net/steffo. Done. Posted at 06:44PM Sep 24, 2007 by steffo in Sun | Comments[1] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hi Steffo,
I followed your guide to set up an openid provider. I ran into an issue and need your help. When I enter my uri in openid client's box, it redirected me to opennsso login page as expected. After I enter my credentials I got "verification cancelled"
Can you shed some light on this issue. Thank you very much.
Best reqards,
Robert
Posted by Robert Nguyen on December 10, 2008 at 01:10 AM CET #