Skip to content Skip to sidebar Skip to footer

Login From Android Http Post To Grails 3 Spring Security

i am trying to create an android application to do something with my database. for example: i run my grails app on port 8080, localhost:8080 then i use POSTMAN and pass paramter li

Solution 1:

The issue is here:

org.springframework.security.authentication.dao.DaoAuthenticationProvider

  • User '' not found

On the provided link slide 6 it says firing organizationFilter

When you look into security filters. They are actually those static rules that I mentioned earlier.

so something is of a conflict there and the rule is being bypassed then it attempts to login (with no user credentials).

It is all there in there logs just a matter of interpreting it correctly

Right.. Comment out this first

//grails.plugin.springsecurity.securityConfigType = 'Requestmap'

//Then add

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
    [pattern: '/',               access: ['permitAll']],
    [pattern: '/error',          access: ['permitAll']],
    [pattern: '/index',          access: ['permitAll']],
    [pattern: '/index2.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']],
    [pattern: '/login/ajaxSuccess',       access: ['permitAll']],
    [pattern: '/login/ajaxSuccess/**',       access: ['permitAll']],
    [pattern: '/**/ajaxSuccess/**',       access: ['permitAll']]
]

I haved added 3 new rules at the very bottom, the very first one should fix the issue. But I added them just incase. Then the line above it you have changed from annotation to Requestmap but then you have controllerAnnotations.staticRules you do need to pay attention to the finer details here.

If you set something to be something else then you need relevant configuration for that. Please note if you do wish to stick with Requestmap then maybe you need to configure

grails.plugin.springsecurity.interceptUrlMap = [
                [pattern: '/',               access: ['permitAll']],
                [pattern: '/something/**',          access: ['ROLE_ADMIN', 'ROLE_USER']],
                [pattern: '/**',          access: ['permitAll']],
]

For now I would stick with securityConfigType: Annotation

Post a Comment for "Login From Android Http Post To Grails 3 Spring Security"