Skip to content

In @RepositoryRestController AuthenticationPrincipalArgumentResolver (@AuthenticationPrincipal) not involved [DATAREST-1312] #1672

@spring-projects-issues

Description

@spring-projects-issues

Grigory Kislin opened DATAREST-1312 and commented

Test project located at https://github.com/gkislin/spring-data-rest-authentication-principal

Check with  [admin@javaops.ru|mailto:admin@javaops.ru] / admin:

https://github.com/gkislin/spring-data-rest-authentication-principal/blob/master/src/main/java/ru/javaops/bootjava/restaurantvoting/web/VoteController.java#L54

http://localhost:8080/api/votes/current

OK, AuthenticationPrincipalArgumentResolver involved

https://github.com/gkislin/spring-data-rest-authentication-principal/blob/master/src/main/java/ru/javaops/bootjava/restaurantvoting/web/RestaurantController.java#L39

[http://localhost:8080/api/restaurants/3/vote]
java.lang.NullPointerException: nulljava.lang.NullPointerException: null at ru.javaops.bootjava.restaurantvoting.AuthUser.<init>

AuthenticationPrincipalArgumentResolver doesn't involved.
SecurityContextHolder.getContext().getAuthentication() works fine


Affects: 3.1.3 (Lovelace SR3)

Reference URL: https://github.com/gkislin/spring-data-rest-authentication-principal

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions