Authenticating Kentico webforms using Identity Server 4

Sriram Vedula asked on June 14, 2020 09:14

Hello,

We are planning to authenticate our Kentico Webforms application using Identity server. I have been through the below article on how to implement this.

Integrating Auth0 With Kentico - https://devnet.kentico.com/articles/integrating-auth0-with-kentico

This article provided a clear picture on how to implement this and we are able to implement login functionality without any hastle. How ever, we are not completely sure how to implement logout as we do not have the token saved any where.

While implementing login, we are using the token to log the user in using kentico API - AuthenticationHelper.AuthenticateUser.

I tried saving the token in a session but at this stage the session is null and it is not accessible.

Any help on this is much appreciated.

Regards, Sriram.

Recent Answers


Juraj Ondrus answered on June 15, 2020 07:40

What about using the custom event handler as described here? You should be able to handle the sign out security event too.

0 votesVote for this answer Mark as a Correct answer

Sriram Vedula answered on June 15, 2020 07:47

Thanks Juraj for your response.

Like you said, yes I can get hold of sign out event, but in order to sign out from the identity server, we need to have a valid token which we do not have. (like I said in my question)

Without signing out from the identity server, even though we sign out from kentico the login event triggers again and logs the user back in. so from the end user perspective, the sign out doesn't even work.

Please let me know if I am not clear.

Regards,

Sriram.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on June 15, 2020 08:14

Well, this is something you need to get from the identity provider - there should be some API to use to log the user out. So, you can fire that code within the event handler so the user gets logged out from the 3rd party system too.

0 votesVote for this answer Mark as a Correct answer

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