Secure Your ASP.NET Web Forms Application with OpenID Connect and Okta

Eric Kreger

I have run into an issue where i have a valid user but their permissions have been removed from the application in Okta. After the user logs in they receive the following error:
“OpenIdConnectMessage.Error was not null, indicating an error. Error: ‘access_denied’. Error_Description (may be empty): ‘User is not assigned to the client application.’. Error_Uri (may be empty): ‘’.”
Researching that issued i found that i need to implement the OpenIdConnectAuthenticationNotifications AuthenticationFailed method in the startup. When i do that and try to redirect the user to a Access Denied page, I am receiving a 400 Bad Request on the page. Can anyone shed light on how to address this scenario?