Skip to content
Advertisement

Tag: spring-security

What is the use of @EnableWebSecurity in Spring?

As per the Spring documantation: Add this annotation to an @Configuration class to have the Spring Security configuration defined in any WebSecurityConfigurer or more likely by extending the WebSecurityConfigurerAdapter base class and overriding individual methods: Or As this @EnableWebSecurity depicts, is used to enable SpringSecurity in our project. But my question is that even if I don’t annotate any of

CORS interfering with Spring Security oauth2

I’m having problems trying to get a token from oauth/token from the browser. I have a Spring Boot application with Spring Security and Spring Security oauth, and I’m trying to authenticate from a javascript SPA in a different port. When CORS is disabled in the backend, I can get tokens from the oauth endpoints no problem, using either Postman or

Handle Security exceptions in Spring Boot Resource Server

How can I get my custom ResponseEntityExceptionHandler or OAuth2ExceptionRenderer to handle Exceptions raised by Spring security on a pure resource server? We implemented a so whenever there is an error on the resource server we want it to answer with The resource server uses the application.properties setting: to authenticate and authorize a request against our auth server. However any spring

Spring Security – multiple logged users

I have a problem with Spring Security configuration. When I log in on one computer as a user1 and then I will log in as a user2 on another computer, the first computer after refresh sees everything as a user2. In other words, it is impossible to have two sessions with different users at the same time. Configuration: Spring Security

How to apply Spring Security filter only on secured endpoints?

I have the following Spring Security configuration: The authenticationTokenFilterBean() is applied even on endpoints that do not match /api/** expression. I also tried adding the following configuration code: but this still did not solve my problem. How can I tell Spring Security to apply filters only on endpoints that match the secured URI expression? Answer I have an application with

Difference between registerGlobal(), configure(), configureGlobal(),configureGlobalSecurity in Spring security

I have below three code snippets all doing the same thing: creating in-memory authentication. So how it impacts defining it in different method names? registerGlobal configure configureGlobal configureGlobalSecurity First one: Second one: Third one: Fourth: UPDATE 1 : One more thing I would like to add: configure() method is present in WebSecurityConfigurerAdapter class while others are not present. UPDATE 2:

Advertisement