• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

AngularJS post submit login form to Spring security

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

i am using spring security with angularJS.
i submit login form with username and password on post request to the spring security on the server.

the problem is that the authentication fail.
in spring security its fail on UsernamePasswordAuthenticationFilter.java filter
because request.getParameter(usernameParameter); returns null for my post request.


in class UsernamePasswordAuthenticationFilter.java method attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
the attemp is valid only for post request request.getMethod().equals("POST")
but next it try to retrieve username parameter from the post request ( request.getParameter(usernameParameter); ) which return null.

my login post request is :


spring filter code :


1. why do i get username null? how can i fix it?
2. it is POST request can we get parameter from the request by request.getParameter()?

Itamar.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to send userName and password in data array
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic