Skip to content
Advertisement

Tag: spring

Use multiple HttpSessionIdResolver with Spring

I want to use the HTTPSessionIdResolver for everything located under “/api**” and for everything else the standard CookieResolver. How is this possible, so that the two configurations use different resolvers? With my current approach everything uses X-AUTH. I tried to understand the implementation within Spring and I end up in the SessionRepositoryFilter, but of this filter only one instance is

Cannot pass JWT refresh token as an argument

I’m trying to get a new access token using a refresh token in Spring Boot with OAuth2. It should be done as following: POST: url/oauth/token?grant_type=refresh_token&refresh_token=…. It works fine if I’m using InMemoryTokenStore because the token is tiny and contains only digits/letters but right now I’m using a JWT token and as you probably know it has 3 different parts which

Why is the shutdown endpoint not enabled in my application?

I am trying to add a shutdown endpoint actuator/shutdown in my Spring application as explained in this tutorial so that I can gracefully shutdown the application using a call like curl -X POST localhost:8080/actuator/shutdown. I added to my pom.xml and to src/main/resources/application.yaml. But when I run curl -X POST localhost:8080/actuator/shutdown, I get the following response: I don’t see the shutdown

How to disable the Hypersistence banner when using hibernate-types-52 in Spring Boot?

I use the com.vladmihalcea:hibernate-types-52 dependency in my Spring Boot Project. And, I notice that on application boot, some large log messages were added: The hint is nice and the project sounds actually interesting, but still want to have the banner removed from my application. Answer There is a description by the Project Owner why the banner was introduced, why it

No mapping for static-resources Spring Boot

In my Spring-Boot application, js and css files do not work, it says 404 not found. My html-page includes the following: I configured resources so: But in logs I receive: This is the location of static-sources: What am I doing wrong? Answer By default, this handler serves static content from any of /static, /public, /resources, and /META-INF/resources directories that are

Adding Same Site Header to JSESSIONID Spring Security

Google chrome has introduced changes that require setting the Same-Site header. In order to achieve this, I added a custom filter as follows, Following is the code for Security Configuration However, when I look at the headers received, I get this The filter adds the required fields in all the responses exception the one containing the JSESSIONID cookie. How do

Unable to set Command Line profile in spring boot 2.2

Unable to run spring boot maven project with spring-profiles. I’ve tried the following commands which all return the same error mvn spring-boot:run -Dspring-boot.run.profiles=local mvn spring-boot:run -Dspring.profiles.active=local mvn spring-boot:run -Dspring-boot.profiles.active=local I’m using SpringBoot 2.2.5 and Maven 3.6.3 on Java 11 Edit: Adding Full Debug Logging from suggested command mvn spring-boot:run -Drun.jvmArguments=”-Dspring.profiles.active=local” -X I am getting practically the same logs with every

Advertisement