Grails spring - security authentication failure - dynamic method get <Artefact> Class (artefactName)

I have been working with Grails for about a month now, and we are working with angular now, so we decided to use the REST approach with authentication on tokens.

Unfortunately, while working with the plugin, I have a problem that I still could not fix, an error that I get when trying to authenticate through POST:

Object {email: "test@test.test", password: "TEST"} 

An exception:

2014-11-17 15:25:29,509 [http-bio-8080-exec-8] DEBUG credentials.DefaultJsonPayloadCredentialsExtractor  - Extracted credentials from JSON payload. Username: test@test.test, password: [PROTECTED]
2014-11-17 15:25:29,518 [http-bio-8080-exec-8] DEBUG rest.RestAuthenticationFilter  - Trying to authenticate the request
2014-11-17 15:25:29,524 [http-bio-8080-exec-8] DEBUG authentication.ProviderManager  - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
2014-11-17 15:25:29,563 [http-bio-8080-exec-8] DEBUG rest.RestAuthenticationFilter  - Authentication failed: Dynamic method get<Artefact>Class(artefactName) requires a single String parameter

I would like to note that I do not use the default username for logging in, but instead changed it to "email". This is reflected in my configuration below:

Spring Config.groovy security part:

grails.plugin.springsecurity.active = true
grails.plugin.springsecurity.rejectIfNoRule = true
grails.plugin.springsecurity.fii.rejectPublicInvocations = false
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
   '/**':               ['permitAll'],
]
grails.plugin.springsecurity.rememberMe.persistent = false
grails.plugin.springsecurity.rest.token.rendering.usernamePropertyName = 'email'
grails.plugin.springsecurity.rest.token.rendering.authoritiesPropertyName = 'roles'
grails.plugin.springsecurity.userLookup.usernamePropertyName='email'

grails.plugin.springsecurity.rest.login.useJsonCredentials = true
grails.plugin.springsecurity.rest.login.failureStatusCode = 401
grails.plugin.springsecurity.rest.token.storage.useGorm = true
grails.plugin.springsecurity.rest.token.storage.gorm.tokenDomainClassName = 'AuthenticationToken'
grails.plugin.springsecurity.rest.token.storage.gorm.tokenValuePropertyName = 'token'
grails.plugin.springsecurity.rest.token.storage.gorm.usernamePropertyName = 'email'
grails.plugin.springsecurity.rest.login.active = true
grails.plugin.springsecurity.rest.login.usernamePropertyName = 'email'
grails.plugin.springsecurity.rest.login.passwordPropertyName = 'password'
grails.plugin.springsecurity.rest.login.endpointUrl = "/webapi/user/login"
grails.plugin.springsecurity.rest.logout.endpointUrl = "/webapi/user/logout"

, REST , ? - Grails, Spring -Core Spring -Rest :

Dynamic method get<Artefact>Class(artefactName) requires a single String parameter

!

+4
1

Spring ? grails.plugin.springsecurity.userLookup.userDomainClassName, DefaultGrailsApplication.getDomainClass(null), ,

  • Poundex
+5

All Articles