Supporting both authentication types

Supporting both authentication types

Old forum URL: forums.lhotka.net/forums/t/6933.aspx


jureleskovec posted on Tuesday, May 12, 2009

I read about the switching between custom and windows authentication through the CslaAuthentication attribute. What about the scenario where you have to support both of them? How can I do it?


-- Jure

JoeFallon1 replied on Tuesday, May 12, 2009

In that scenario you need to implement custom. As part of the custom code you obtain the Windows token and "read it" to gather its data. But the values need to exist in the custom Principal and Identity classes.

Joe

tiago replied on Tuesday, May 12, 2009

Hi Jure,

I made some changes to PTracker authentication in order to have Windows Authentication. In fact you just need to change CslaAuthentication attribute. The nicest thing about it is that you can have both at the same time.

If the users that is authenticated under Windows exists in the users table, it gets logged on with no further questions. Otherwise (the windows user name doesn't exist in the users table) the login window will ask for username/password. This is quite useful when you have an application on a client but your laptop is not in the client's domain. You can still use your laptop and login in the application using the application admin username.

FAQ: How to use Windows authentication in PTracker (PTWin) (C#)

http://forums.lhotka.net/forums/post/28161.aspx

Copyright (c) Marimer LLC