Windows authentication logon

Wei Wang asked on April 29, 2020 21:52

Hi,

We are using Kentico 9 product Windows authentication method for the website. Is there a way to implement something like this: right after the user is authenticated, pop up a window to ask him to go to a page or form first to acknowledge something, and then will he be able to get to browse the whole website?

Thanks

Recent Answers


Dmitry Bastron answered on April 30, 2020 18:36

Hi Wei,

You can try the following:

  • Hook to SecurityEvents.Authentication.Execute event
  • Check if User in AuthenticationEventArgs is not null (which should be when internal authentication completed successfully) and save some flag in request context, session or cookie (depending on your exact needs)
  • Create a custom web part that shows this pop-up on page load and display this web part only if the flag above is set
1 votesVote for this answer Mark as a Correct answer

Wei Wang answered on April 30, 2020 18:52

I will try. Thank you!

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on April 30, 2020 19:58

Hi Dmitry,

Sorry I am pretty new to Kentico CMS tool. So how do I hook to the SecurityEvents.Authentication.Execute event? Not from CMS desk but in the Visual Studio code? Thanks

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on May 1, 2020 10:27

This is an article with the example of using this event in the code. Even though it is for handling external authentication, it shows the idea how to use this event in the code.

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on May 1, 2020 14:43

Thank you!

0 votesVote for this answer Mark as a Correct answer

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