How to trap exception in MVC when user is not authorized


We have a simple test app based mainly on the Okta MVC Example.

I’m puzzled because if we have a user login that is not authorized in Okta for the app our app throws and exception and they see the familiar ASP.NET yellow stack trace.

Surely we can modify the app to trap or catch this error and display a helpful page?