Silverlight login failure reason notification
Silverlight login failure reason notificationOld forum URL: forums.lhotka.net/forums/t/8457.aspx
Russ posted on Tuesday, February 02, 2010Does anyone have a suggestion of how to return the reason a login attempt has failed in a Silverlight application?
It is strictly forbidden to throw an exception in the AppPrincipal or AppIdentity objects during the login process so that a valid Principal (or UnauthenticatedPrincipal) is always returned. This makes it difficult to notify the user of the reason their login attempt failed. Some possible reasons are: incorrect username password combination, password has expired, user account is inactive, server not accepting logins at this time etc.
The reason is detected in the DataPortal_Fetch method of the AppIdentity.Server.cs. The question is how to return that reason to the user. Is there a better method than to simply add a reason property to the AppIdentity class?
Thanks in advance
RockfordLhotka replied on Wednesday, February 03, 2010That seems like a reasonable solution. The IIdentity already has IsAuthenticated. If that value is false, it seems reasonable to think there could be a AuthenticationFailureReason property to explain why. Normally it would be null, because normally the user would be authenticated, so the overhead would be quite low.
Copyright (c) Marimer LLC