Skip to content
Advertisement

Tag: spring-security

Why is remember-me a lesser authentication then full-authentication in spring-security?

This is a conceptual question about the fact, that authentication has different grades in spring security. There is a grade for anonymous authentication also called IS_AUTHENTICATED_ANONYMOUSLY and remember me authentication IS_AUTHENTICATED_REMEMBERED the full authentication, when a user just provided his entire credentials and got confirmed aka IS_AUTHENTICATED_FULLY In the implementation of AuthenticatedVoter#isFullyAuthenticated it is clear, that a full authenticated user

Getting an exception when tried to implement Azure AD authentication and authorization in Spring Boot

I receive the following error: Even though I’ve provided the client ID in application.properties. I followed the following link: https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory POM: MAIN: CONTROLLER APPLICATION.PROPERTIES I updated my POM with The new error after updating POM: I’ve updated my POM, now it is building fine, but on login I’m getting AADSTS50011: The reply URL specified in the request does not match

Spring security : How to use @RolesAllowed with @RequestBody

I have a method like this: Request looks like this: Now only certain roles are allowed to access “data_type=A”. I want to use @RolesAllowed or equivalent to block the request based on @RequestBody How should i achieve this? Tx in advannce Answer If you want to filter based on request value, you can use @PreAuthorize. Docs: https://docs.spring.io/spring-security/site/docs/current/reference/html5/#method-security-expressions Some examples: https://www.baeldung.com/spring-security-method-security

Error accessing field by reflection for persistent property [model.Credentials#email] on @EmbeddedID

I’ve been experiencing problems implementing the Authorities on my spring boot application, and after digging a little I realised that maybe the association between my Credentials and Authorities tables, was wrong. In fact it come to my attention that Spring allowed every type of user, (regardless their authority) to access ever method, even the ones I though have been secured.

Spring Security: redirect to single page app in case of 401

When I type into browser any route of my React app, for example: http://localhost/login, the request hits my server, and my server responds with 401 Unauthorized. When request is not an authorized backend api I’d like to handle the request in my react routing. WebSecurityConfig.java: RestAuthenticationEntryPoint.java: Is there a way to forward the request to index.html in RestAuthenticationEntryPoint? Answer I’ve

Spring Security 5 – My custom UserDetailsService is not called

I have found several questions about similar problems but none of them is exactly my case. I am using the following class to configure the authentication/authorization in my application (a REST API). No matter what I try, my custom ApplicationUserDetailsService is never used. Can anyone see what is wrong with this configuration? I have also tried to specify the following

Advertisement