So I was trying to make a simple spring security hardcoded security just to check how my app is working before connecting it to the DB but before that it start showing me error 500. Here is my Configuration file Here is my webSecurity Configuration class with In memory authentication with some sample data. He…
Tag: spring
Spring cloud config match profile
I have a hierarchy structure of applications files in my git repository as follows: uri: https://bitbucket.org/repositorios-company/configuration-files Directory: -authorization-service —-…
Why I can StompCommand.CONNECT without JSESSIONID, but X-XSRF-TOKEN is required?
My goal is to secure a WebSocket endpoint e.g ws://localhost:8080/chat. What I did: I tried to create WebSocket connection with STOMP AbstractSecurityWebSocketMessageBrokerConfigurer WebSocketMessageBrokerConfigurer WebSecurityConfigurerAdapter My expected result is: The WebSocket connection should fail becau…
Deployed .war generating error: template might not exist or might not be accessible
I have a spring boot application that runs fine on localhost. I access it with http://localhost:8080/home. Now I want to deploy the application to a hosting server. Generated the .war and deployed it there. Configured http://www.customdomain.com/hostingpath/ to be the root path for the app. So that should map…
Java – Spring Boot – Reactive Redis Stream ( TEXT_EVENT_STREAM_VALUE )
I want to write an endpoint which always shows the newest messages of a redis stream (reactive). The entities look like this {‘key’ : ‘some_key’, ‘status’ : ‘some_string’}. So I would like to have the following result: Page is called, content would be for instan…
class org.springframework.security.core.userdetails.User cannot be cast
I use SpringSecurity in my web-project. When I try to login with username and password, I have this error in my stacktrace : Below, I will put classes where I think the problem comes from. Here my JwtUser.java : Here my AuthController.java : Here my UserDetailsServiceImpl.java : For information, I use java 11…
Spring boot security in kotlin with users and roles
I have to work on an application that old interns started. The backend is made with spring-boot and using Kotlin, which I’m very new to both. The backed is a RESTful API and I need to implement an authentication and authorizations to limit the access to specific users the CRUD methods. There’s bas…
Protect individual resources from Spring Boot via Keycloak
I’ve got a very simple Spring Boot application with resources at /repositories and /persons. Here is my build.gradle file. Here is my SecurityConfig.java file. Here is my application.yaml file. It’s all on my local machine and Keycloak and Postgres are started via docker compose. I’ve got th…
Name expected error when using @EnableAutoConfiguration in Spring Boot
I was having a similar error to the one found here and also here. I attempted to use @EnableAutoConfiguration to fix the error as was suggested, but IntelliJ gives me an error and says “Name expected”. I am unsure what exactly is causing this problem. One possible difference is that I am working i…
Spring boot application with spring data cassandra failing to start
I have a spring boot application with spring web & spring data cassandra as dependencies. And I have a main method in a class annotated with @SpringBootApplication. I run this application & run into the below error. I am guessing this might be a some dependency related problem, but can’t figure …