Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register while login with openid spring security

I have followed this demo implementing login using spring security and openid.

I am successful implementing it, But using spring security I have to provide the user details in the userservice section of spring-security.xml

<security:user name="http://krams915.myopenid.com/" password="" authorities="ROLE_USER, ROLE_ADMIN" />

I want to implement register and login cycle through openid in one go. I am not getting how to go ahead without providing username in userservice, as the user that visits my site will not be registered previously.

Any help or guidance would be great.

Thanks in Advance.

like image 259
user549757 Avatar asked Aug 25 '11 15:08

user549757


1 Answers

The openid sample with spring security has some examples of using the attribute-exchange tag to pull data from OpenId providers. This will let you grab required data (or at least some of it) for users, especially if they are coming in new.

The CustomUserDetailsService in that example also shows one possible way to create new accounts in your application when new users come in via OpenId that links their OpenId identifier to a new user account within your application.

like image 109
cdeszaq Avatar answered Oct 06 '22 00:10

cdeszaq