@Bean
    // One of your authentication providers.
    // They ensure that the credentials are valid and populate the user's authorities.
    DaoAuthenticationProvider daoAuthenticationProvider(
            final UserDetailsService userDetailsService,
            final PasswordEncoder passwordEncoder) {

        final DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setUserDetailsService(userDetailsService);
        provider.setPasswordEncoder(passwordEncoder);
        return provider;
    }
The security configuration. If you use spring security for web applications most of the stuff is already configured.

@author Daniel Theuke (daniel.theuke@heuboe.de)
examples/security-grpc-server/src/main/java/net/devh/boot/grpc/examples/security/server/SecurityConfiguration.java