public class SecurityDataFetcherExceptionResolver extends DataFetcherExceptionResolverAdapter
DataFetcherExceptionResolver
for Spring Security exceptions. For use in applications with a non-reactive
transport (e.g. Spring MVC HTTP endpoint).Constructor and Description |
---|
SecurityDataFetcherExceptionResolver() |
Modifier and Type | Method and Description |
---|---|
protected GraphQLError |
resolveToSingleError(Throwable ex,
DataFetchingEnvironment environment)
Override this method to resolve an Exception to a single GraphQL error.
|
void |
setAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver)
Set the resolver to use to check if an authentication is anonymous that
in turn determines whether
AccessDeniedException is classified
as "unauthorized" or "forbidden". |
from, isThreadLocalContextAware, resolveException, resolveToMultipleErrors, setThreadLocalContextAware
public SecurityDataFetcherExceptionResolver()
public void setAuthenticationTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver trustResolver)
AccessDeniedException
is classified
as "unauthorized" or "forbidden".trustResolver
- the resolver to useprotected GraphQLError resolveToSingleError(Throwable ex, DataFetchingEnvironment environment)
DataFetcherExceptionResolverAdapter
resolveToSingleError
in class DataFetcherExceptionResolverAdapter
ex
- the exception to resolveenvironment
- the environment for the invoked DataFetcher
null
if unresolved