Skip to content

@SubscriptionMapping missing AuthenticationPrincipal #861

Closed
@madwind

Description

@madwind

When I upgrade from springboot 3.1.4 to 3.2 @SubscriptionMapping seemed to be missing AuthenticationPrincipal

    @SubscriptionMapping
    public Flux<Video> recentVideos(@AuthenticationPrincipal Account account) {
        return userService.listRecentVideos(account.getId());
    }
org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: No Authentication
	at org.springframework.graphql.data.method.annotation.support.PrincipalMethodArgumentResolver.resolveAuthentication(PrincipalMethodArgumentResolver.java:68) ~[spring-graphql-1.2.4.jar:1.2.4]

@QueryMapping works fine.

    @QueryMapping
    public Mono<User> me(@AuthenticationPrincipal Account account) {
        return userRepository.findByAccountId(account.getId());
    }

but in 3.1.4 it works fine.

Metadata

Metadata

Assignees

Labels

in: coreIssues related to config and core supporttype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions