Automatic user authentication

Let's take a look at the following steps:

  1. The ProviderSignInController controller is initialized with an authentication SignInAdapter, which is used to complete a provider sign-in attempt by signing in the local user account with the specified ID:
        //src/main/java/com/packtpub/springsecurity/configuration/        SocialConfig.java        @Bean        public SignInAdapter authSignInAdapter() {           return (userId, connection, request) -> {             SocialAuthenticationUtils.authenticate(connection);             return null;           };         }
  1. In the SingInAdapter bean, from the preceding code snippet, we used a custom authentication utility method to create an Authentication object in the form of UsernamePasswordAuthenticationToken, and added it to SecurityContext based ...

Get Spring Security - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.