Hi all!
Maybe this could be a minor mistake by my side, but im really struggling to solve this.
My stack is:
Spring Boot 3.3 (Kotlin and Gradle)
Vaadin 24
Hilla with react
I already configured my application to use stateless authentication and its working ok for login and logout.
I have an endpoint that has for example this method:
@RolesAllowed("ROLE_PLAYER")
fun getCommanderSummary(): CommanderSummaryViewModel {
...
}
It works perfectly, it only works when logged in with ROLE_PLAYER.
Now, for the same Endpoint, i have another method that is a stream:
@RolesAllowed("ROLE_PLAYER")
fun getPlayerUpdates(): Flux<String> {
...
}
For this route, i am getting Access Denied, even though the other one works from the same React component.
The endpoint is called CommanderEndpoint
In the frontend, im doing like this:
const sub = CommanderEndpoint.getPlayerUpdates().onNext((update) => {
if (update !== undefined) {
setResourceUpdate(update);
}
});
This is the call that is getting denied.
If i change to @AnonymousAllowed in the getPlayerUpdates method, it works.
For some reason, it seems that the subcription call made to the backend doesnt take the authentication into account.
Is this a bug or am i doing something wrong?
Thanks in advance!