Trying to figure out how to properly implement OpenID authentication with Spring Security.
public class OpenIDUserDetailsService implements
UserDetailsService,
AuthenticationUserDetailsService {
@Override
public UserDetails loadUserByUsername(String openId) throws
UsernameNotFoundException, DataAccessException {
}
@Override
public UserDetails loadUserDetails(Authentication token) throws
UsernameNotFoundException {
}
private MyCustomUserDetails registerUser(String openId, String email) {
...
}
}
I am considering a scenario where a user is not already registered in my application. To register a user, I need to know his OpenID and email.
When the OpenID provider redirects the user back to my application, it is called loadUserByUsername(), but in this case I only know about the OpenID user. So, I quit UsernameNotFoundExceptionand then loadUserDetails()never get called, so I can not register the user.
? , - FakePartialUserDetails loadUserByUsername(), , loadUserDetails(), , MyCustomUserDetails?
Spring Security 3.0.7.RELEASE