0

I am trying to get successfully integrate Spring security rest plugin

But I am constantly failed,I am using the memcahed for token storage. Config.groovy Setup which I used to implement the plugin is :

//login end point url

grails.plugin.springsecurity.rest.login.active=true
grails.plugin.springsecurity.rest.login.endpointUrl='/api/login'
grails.plugin.springsecurity.rest.login.failureStatusCode='401'

//for  memcached
grails.plugin.springsecurity.rest.token.storage.useMemcached=false
grails.plugin.springsecurity.rest.token.storage.memcached.hosts='localhost:11211'
grails.plugin.springsecurity.rest.token.storage.memcached.username=''
grails.plugin.springsecurity.rest.token.storage.memcached.password=''
grails.plugin.springsecurity.rest.token.storage.memcached.expiration=3600

//token generation
grails.plugin.springsecurity.rest.token.generation.useSecureRandom=true
grails.plugin.springsecurity.rest.token.generation.useUUID=false

I making a request on /api/login via Post man rest client with

{
    "username": "john.doe",
    "password": "dontTellAnybody"
}

json data but it gives me spring security auth page's html in response, Am I doing some wrong configuration?Is there any futher configuration is required.I mentioned that I am using memcache for token storage.Any Idea will be helpfull for me.

Edit: please see the logs file

Edit2 : please check this log file

ABC
  • 4,263
  • 10
  • 45
  • 72
  • Could you please enable debug output and paste it here? I also need to see the full URL you used to make your request. – Álvaro Sánchez-Mariscal Apr 02 '15 at 08:48
  • I have added the log file , please check and the url which I am using is `http://localhost:8080/restspring/api/login`, this is the post request with `{ "username": "john.doe", "password": "dontTellAnybody" }` data. – ABC Apr 02 '15 at 09:04
  • @Álvaro Sánchez-Mariscal I was using wrong configuration for memcahce .i.e `grails.plugin.springsecurity.rest.token.storage.useMemcached=false` here I have given the false but It should be true and now it is working. Thanks for your time and such a nice plugin. – ABC Apr 02 '15 at 09:34
  • @ÁlvaroSánchez-Mariscal I have implemented this plugin successfully in brand new project but when I integrate this plugin in an another grails project which uses ajax based login authentication it creates an issue, I have added the logs in question(Edit 2) please have a look. – ABC Apr 02 '15 at 12:59
  • @ÁlvaroSánchez-Mariscal Project in which I am facing issue is using `@Secured` annotation throughout the app, could this be a problem? – ABC Apr 03 '15 at 05:48
  • The key message in the logs is this line: `No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken`. Have you installed `spring-security-core` plugin **as well as** `spring-security-rest`?. Anyway, this latest issue you are experiencing seems totally unrelated with your original question. I suggest you to post a brand new question, providing all the details there. – Álvaro Sánchez-Mariscal Apr 08 '15 at 14:12

0 Answers0