title: Getting 401 error when trying to access /api/login in Grails 3 and Spring Security Rest
body: <p>I am developing a REST API using <strong>Grails 3</strong> and Spring Security Rest plugin.<br>
  I am using <strong>MySQL 5.7.19 as my backend.</strong><br>
  The app seems to work fine and I can access all endpoints when I use default backend provided by Grails.<br>
  But when I use <strong>MySQL</strong> as my back end I get a <strong>401 error</strong> when trying to access <strong>/api/login endpoint</strong>.<br>
  All kinds of help will be highly appreciated.<br>
  Following is my application.groovy file but I don't think there is an issue within this since the app works fine when using default backend provided by Grails.  </p>
  
  <pre><code>// Added by the Spring Security Core plugin:
  grails.plugin.springsecurity.userLookup.userDomainClassName = 'todo.User'
  grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'todo.UserRole'
  grails.plugin.springsecurity.authority.className = 'todo.Role'
  grails.plugin.springsecurity.controllerAnnotations.staticRules = [
      [pattern: '/',               access: ['permitAll']],
      [pattern: '/error',          access: ['permitAll']],
      [pattern: '/index',          access: ['permitAll']],
      [pattern: '/index.gsp',      access: ['permitAll']],
      [pattern: '/shutdown',       access: ['permitAll']],
      [pattern: '/assets/**',      access: ['permitAll']],
      [pattern: '/**/js/**',       access: ['permitAll']],
      [pattern: '/**/css/**',      access: ['permitAll']],
      [pattern: '/**/images/**',   access: ['permitAll']],
      [pattern: '/**/favicon.ico', access: ['permitAll']]
  ]
  
  grails.plugin.springsecurity.filterChain.chainMap = [
      [pattern: '/assets/**',      filters: 'none'],
      [pattern: '/**/js/**',       filters: 'none'],
      [pattern: '/**/css/**',      filters: 'none'],
      [pattern: '/**/images/**',   filters: 'none'],
      [pattern: '/**/favicon.ico', filters: 'none'],
      [pattern: '/api/**',         filters: 'JOINED_FILTERS,-anonymousAuthenticationFilter,-exceptionTranslationFilter,-authenticationProcessingFilter,-securityContextPersistenceFilter,-rememberMeAuthenticationFilter']
  ]
  </code></pre>