Making a log-in page for authorizing users in the Kentico UI

Hosam Abdeltawab asked on October 1, 2020 17:29

I am authorizing a user log-in before they can access any page on my MVC app. In the kentico UI CMS app, it is giving me an error because it is trying to access the principal property while it haven't been set yet. So, the user has to log-in in order for the CMS is able to render the pages. Is there a way on the Kentico UI CMS app to have it have the user log-in first before accessing any page? in other words, always redirect them to a log-in page before accessing any other page?

Recent Answers


Brenden Kehren answered on October 1, 2020 20:07

Have you checked out the MVC authentication in the documentation?

0 votesVote for this answer Mark as a Correct answer

Hosam Abdeltawab answered on October 2, 2020 18:09

I think this is only for the kentico users. I have an AuthenticationAPI that the user goes through on my main website's log-in page. But, when I open the CMS and try to open a page it gives an error "Object reference not set to an instance of an object" because it tries to view the and their is no user signed in yet.

In other words, all the pages shouldn't be accessible until a user goes through my AuthneticationAPI and is authenticated. With that being said, can I have something on Kentico UI that facilitates that?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.