I have following Spring Security configuration: And following configuration is used: Now I need to do impersonation(https://datatracker.ietf.org/doc/html/rfc8693). So I need to pretend as some user. I need it because of “current user” logic inside some-app application. How can I reconfigure to achieve it ? P.S. I tried to google it but I haven’t found anything relevant. Answer RFC 8693 Token
Tag: spring
PostgreSQL query works on pgAdmin but not in Spring Boot
The query SELECT * FROM books WHERE (isbn || ‘ ‘ || author || ‘ ‘ || name) ILIKE ‘%el%’ returns from the full db when executed in pgAdmin (PostgreSQL tool) But the same query doesn’t seem to work when I try to run it in Spring Boot, it returns an empty list. I do not know if my query
How to solve error: package org.springframework.context.annotation does not exist import org.springframework.context.annotation.Bean?
After updating the gradle wrapper to version 7.3.2 I get the following error when trying to build my spring boot project: Why is this happening? Update: Found the problem, but do not know how to fix yet. I have multiple modules in my project. I have a “common” module which is used by other modules. With the old gradle version
Why this API is forbidden for an user having a JWT token containing the “correct” authority?
I am not so into Spring Security and JWT token and I have the following doubt on a project which I am working on. Basically I have this SecurityConfiguration class containing my Spring Security configuration, as you can see it is intended to handle JWT token: As you can see in the previous code I have the following two matcher
JPA Cast BigDecimal as string
I’m using JPA to query a database, but something strange happens. In some cases the cast works and compiles fine, but with a BigDecimal it doesn’t let me use the cast to make a LIKE with a String. Here is a part of the code that works: pesoObjetivo is a data type Double But when I try to perform the
Spring security loginProcessingUrl only works on localhost
I have built an application by using Spring Boot and Thymeleaf. My application works as supposed in my localhost, but when I package it as a .war and deploy it in a test tomcat server, it prompts the login page and then either redirects me to the error page or brings me back to the login page. I have tried
Spring Boot thymeleaf bad request 400 instead of showing user error
I am trying to submit a form using post request and first validate inputs. However when I make bad inputs (for example all empty) instead of showing error I get bad request (400). For showing error I am using th:if and th:errors tags in HTML. If I submit all valid inputs, there is no problem. Controller class: HTML form: Model
Failed to load ApplicationContext for a java based config test
I want to test the Repository-Layer of my SpringBootApplication, but it fails to load application context. By the way I am using Java 17. Here is the error Here is My simple test class. Here is the application.properties file And finally here is my pom.xml Configuration for webclient bean I checked out different Spring-boot-test annotations like @SpringBootTest, but nothing changed.
Local Mongo DB Container Access with Kubernetes Service Endpoint in K3s is not working
Earlier I used earlier kubeadm to create an endpoint from my local MongoDB which is running in a Docker container, now we have switched from kubeadm to k3s because it is a lot of easier to use. Now we are not able to use the MongoDB endpoints, it is reachable inside the Kubernetes cluster. I will share the necessary information
ClassCastException being encountered even with correctly imported or assigned classes
I am receiving a ClassCastException randomly/intermittently. I already tried clearing and invalidating my local caches, doing an mvn clean install and depedency reimports. Still the issue persist. It also exist on the deployment of my microservice to aws. My directory structure is as follows. This BopAccountType (see screenshot) classes are the same with casa directory in terms of structure of