-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Hello again,
Another kotlin specific problem around the spring SecurityContextHolder.getContext().
I have made a sample commit here with a failing test case
Essentially, SecurityContextHolder.getContext().authentication is null in suspend functions generated by the grpc kotlin stubs. I'm not super familiar with how spring stores this, I believe its threadLocal? Kotlin suspend probably messes this up with how it handles coroutines.
I have added the following block to both sample java grpc-oauth2 and grpc-server-kotlin, and this only fails in grpc-server-kotlin which should confirm its a kotlin stubs issue
if (SecurityContextHolder.getContext().authentication != null) {
throw RuntimeException(" SecurityContextHolder Authentication not set")
}I will hopefully have some time to look into this over winter break.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request