Raise AuthenticationCredentialsNotFoundException if Principal
is not present and declared as not optional
#714
Labels
Principal
is not present and declared as not optional
#714
Currently when defining a query or mutation method that has a non-nullable
Principal
argument, it fails with "Unresolved NullPointerException for executionId ..." when no principal is present in the security context.The same scenario in a
@RestController
would result in401 Unauthorized
response.It would be convenient if spring-graphql automatically validated the presence of a principal, when the argument is defined as non-null, and throws an
AuthenticationException
when not set, which then could be handled in an exception resolver.The text was updated successfully, but these errors were encountered: