Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

AngularJS post submit login form to Spring security

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Try to send userName and password in data array
 
and POOF! You're gone! But look, this tiny ad is still here:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic