• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with SecurityContextHolder.getContext().getAuthentication()

 
Alejandro Barrero
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create an aplication STS from "http://websystique.com/springmvc/spring-mvc-4-and-spring-security-4-integration-example/" which acesses the database diectly from Hibernate. The pmo uses:

I was requested to change the application to use Spring Data with JPA in Inlellij Idea using Gradle; the problem I am having is that the controller has among other methods:

The problem is that SecurityContextHolder.getContext().getAuthentication(); is giving me a null value, although it works fine in STS, and I have not been able to determine what is the problem.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!