What exception is thrown by the security API when a user attempts to access a resource that they are not authorized for?
-
SecurityException
-
AccessException
-
AuthenitcationException
-
Exception
A
Correct answer
Explanation
When a user attempts to access a resource without proper authorization in the security API, a SecurityException is thrown. This exception indicates that the authentication was successful but the user lacks the required permissions for the specific resource. AccessException is not a standard security API exception, and AuthenticationException would be thrown for authentication failures (wrong credentials), not authorization issues.