Skip to content
Advertisement

Tag: spring-mvc

Spring Security roles issue

I overrode the method in the SpringWebConfig and I want to give all pages of application only for admins. When I try to open page http://localhost:8080/api/v1/skills/ without any authorization I have a correct result instead of 403. Maybe I’m wrong with my config? Full project https://github.com/Wismut/crud_developers Answer Add the following class inside config package

How to return CREATED status (201 HTTP) in ResponseEntity

There is a Spring-MVC application. In controllers, when returning the results of methods, I return via ResponseEntity<>. On success, I return (200 statutes) the OK-method. But when creating something, I would like to return the CREATED-method (201 status). I just can’t understand what kind of URL to ask in parentheses when calling through CREATED. How can this be implemented? Now

SpringMVC, why ‘@RequestBody String body’ stops working after adding MappingJackson2HttpMessageConverter

need some help with jackson2 and springMvc. Issue: when adding MappingJackson2HttpMessageConverter jsons fail to parse (previously they did parse) with error below. I have following @Controller method in code: And it have been working just fine until I’ve decided to add MappingJackson2HttpMessageConverter() into converters. Like this: but after I do so, my requests stop to work with the following error

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

The increment size of the sequence is set to [50] in the entity mapping while the associated database sequence increment size is [1]

I’m following the Learn Spring 5 etc on udemy and I’m at the part where we test our application. Everything worked fine till now, i was able to connect to the postgreSQL database and all but now I’m stuck at this test failing since 2 days. I don’t understand what is causing the Test to fail. The application run but

Advertisement