This Week in Spring: NoHTTP, Organizational Consistency, Kotlin Microservices

Hi, Spring fans! Can you believe it? We’re already almost halfway through June! Summer’s nearly here! It’s 97 degrees Fahrenheit/37 degrees Celsius in San Francisco! That’s nuts! I’m glad I’m in the beautiful Amsterdam and Eindhoven, NL, beating the heat, though. What a privilege. We’ve got a busy week, as always, so let’s get to it!

This Week in Spring: Releases, Podcasts, Cloud, and Spring Security

Hi, Spring fans, and welcome to another installment of This Week in Spring! This week, I’m in sunny California, then it’s off to Istanbul, Turkey, for the epic SpringOne Tour event. Then, I'm off again to Chicago, Illinois, for the better-and-better GOTO Chicago show. I hope to see you there!

We’ve got a busy week in Spring, so without further ado, let’s get to it!

Spring Data-LDAP: Part 2

Now, since we have plugged in the LDAP information, it is time to stitch it with Spring Security. The easiest thing to do is:

@Configuration
@EnableWebSecurity(debug = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    private static final Logger logger = LoggerFactory.getLogger(WebSecurityConfig.class);


    @Autowired
    private LdapContextSource ldapContextSource;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.httpBasic().and().authorizeRequests().antMatchers("/users","/").permitAll()
                .anyRequest().authenticated().and().csrf().disable();
    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.ldapAuthentication().contextSource(ldapContextSource)
                .userSearchBase("ou=users")
                .groupSearchBase("ou=groups")
                .groupSearchFilter("member={0}")
                .userDnPatterns("ou=users,dc=example,dc=com")
                .userSearchFilter("uid={0}");
    }
}


Grails With Spring Security

Spring Security touts a number of authentication, authorization, instance-based, and various other features that make it so attractive to secure applications with.

With this in mind, due to Grails use of Spring’s Inversion of Control Framework and MVC setup, developers sought to use Spring Security to secure Grails.