Ok, so what I want is exactly what this blog is describing: http://hillert.blogspot.com/2010/01/...s-with_27.html. Basically, a normal login along with the choice of an OpenID -- however, if the OpenID is not recognized then redirect the user to a registration page (attributes supplied or not). I will describe what I've done so far, and hopefully get some feedback from you good people
First, I understand that there is an <openid-login />, which is described by Spring Docs:
"Similar to <form-login> and has the same attributes. The default value for login-processing-url is "/j_spring_openid_security_check". An OpenIDAuthenticationFilter and OpenIDAuthenticationProvider will be registered. The latter requires a reference to a UserDetailsService. Again, this can be specified by Id, using the user-service-ref attribute, or will be located automatically in the application context."
Well, OK, this sounds like a starting place, so I added this to my applicationContext.xml:
And added this bean:
<http auto-config="true" access-denied-page="/unauthorized">
<form-login login-page="/login" login-processing-url="/login/process" default-target-url="/"
<logout logout-url="/logout" logout-success-url="/" />
<intercept-url pattern="/admin/**" access="ROLE_admin" />
<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY,ROLE_user"/>
<openid-login user-service-ref="userDetailsServiceOpenID" />
In my authopenid namespace, I've implemented the UserDetailsService class: UserDetails(), loadUserByUsername(..)
<beans:bean id="userDetailsServiceOpenID" class="com.mycompany.authopenid" />
From within this namespace, I attempt to load a user who is associated with this token (from a couchdb db) and return that info as a UserDetails object via loadUserByUsername()...
Where is this object going?? My guess is to OpenIDAuthenticationProvider, since it requires a reference to a UserDetailsService object.
After that, I'm fuzzy about what happens -- if anyone can give me a high-level view of what I'm doing as opposed to what I *want*, I would be extremely grateful!
Lastly, I know what I'm doing is unlike what the author of the blog post does -- so that's my other question, is my way even going to work, or am I going to have to extend some classes the way he does to get the behavior I want?
Thanks so much for reading!