O'Reilly logo

Spring Security - Third Edition by Peter Mularien, Robert Winch, Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required