title: Configuring Spring Boot Security to use BCrypt password encoding in Grails 3.0
body: <p>In Grails 3.0, how do you specify that Spring Boot Security should use <strong>BCrypt</strong> for password encoding?</p>
  
  <p>The following lines should provide a sense of what I think needs to be done (but I'm mostly just guessing):</p>
  
  <pre><code>import org.springframework.security.crypto.password.PasswordEncoder
  import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
  
  PasswordEncoder passwordEncoder
  
  passwordEncoder(BCryptPasswordEncoder)
  </code></pre>
  
  <p>My application loads <code>spring-boot-starter-security</code> as a dependency:</p>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>dependencies {
     ...
     compile "org.springframework.boot:spring-boot-starter-security"
  </code></pre>
  
  <p>And I have a service wired up for <code>userDetailsService</code> using:</p>
  
  <p><strong>conf/spring/resources.groovy</strong></p>
  
  <pre><code>import com.example.GormUserDetailsService
  import com.example.SecurityConfig
  
  beans = {
     webSecurityConfiguration(SecurityConfig)
     userDetailsService(GormUserDetailsService)
     }
  </code></pre>