spring login by social account -


Is it possible to allow users to apply to use their social account in Spring Social?

I think users can add their account to social account in the user account, if there is a user who is not registered in the application and we want to allow him to enter the application, then it It is not possible because we made user connection after creating the connection replayer.

Do you have the definition of

  @Bean (name) = "ConnectionFactoryLocator") public Knekshnfinetrloketr Knekshnficrllaoketr () {ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry (); Registry.addConnectionFactory (New FacebookConnectionFactory (facebookId, facebookSecret)); Return Registry; } @Bean public UsersConnectionRepository SocialConnectionRepository () {new SocialConnectionRepository return (data source, UserRepository, connectionFactoryLocator ()); }  

Where the user stores example is for spring data JPA stores / write to your users in DB to read in the table.

Then you can use the controller provided by the spring-social (if you define the use of the default conf as the beam),

  @Bean public ProviderSignInController providerSignInController () {ProviderSignInController providerSignInController = new ProviderSignInController (connectionFactoryLocator (), socialConnectionRepository (), new SimpleSignInAdapter ()); ProviderSignInController.setSignInUrl ("/"); ProviderSignInController.setSignUpUrl ("/"); Return provider SIGNInController; }  

Observe how to post your username / password (by default / signin / facebook)

If you are logged in by the user the special working with FB you have to define the adapter some information from spring security:

  implements private class SimpleSignInAdapter SignInAdapter {public string sign (? string userId , Connection of connection & lt;> connection, NativeWebRequest request) {...}}  

Comments

Popular posts from this blog

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

c# - Process.Kill() returns access denied -

c# - Using the generic type 'System.Collections.Generic.List<T>' requires 1 type arguments -