I have worked on my Spring Social login (without Spring Security) and now it works great.
Now I have migrated my test- application into my real application which works with Spring Security.
I'am sure that some work has to be done in order to get Spring Social work with Spring Security.
In the class MyProviderSignAdapter#signin(...) I have to authenticate the user which has logged in over e.g. twitter. I' am not sure where to get the email and the password.
Currently I have this config above in my Spring- Security- Config- file (authenticationDao).
This means in my database I have 2 tables tuser and tauthority.
In order to authenticate the user in MyProviderSignAdapter#signin(...) I have to store the "twitter"- user in this 2 tables.
I' am not sure whether I'am right?
Thanks for your help in advance!
<bean id="authenticationDao" class="org.springframework.security.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource" ref="dataSource" />
SELECT email as username, password, enabled
WHERE email = ?;
SELECT u.email as username, authority
FROM tauthority as a, tuser u
AND u.email = ?;
final UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(email, password);
HttpServletRequest req = request.getNativeRequest(HttpServletRequest.class);
final Authentication authentication = providerManager.authenticate(token);