Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Using Java spring security filters properly

 
Ranch Hand
Posts: 38
Python Angular Framework Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Spring security to secure my API with Json Web Token,
And I am authenticating all the APIs that start with "/api/**"

I have a "login" and "sign-up" APIs that don't start with this prefix, so it should pass the security filters.

This is my configuration in "WebSecurityConfigurerAdapter":


And this is the filter I use for validating JWT:


I see that this filter is executed in "login" and "sign-up" even though they don't start with "/api/**" (it is executed twice by the way)
But still, I can log in and sign up successfully

Is this a valid behavior?
If not, what am I missing here?
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!