StrataFrame Security Documentation Send comments on this topic.
Authenticating Users

Glossary Item Box

Authenticating Users

Authenticating users within a web application is very similar to authenticating users within a Windows environment; however, no default login form or form template is provided for web applications. As such, authentication must be done programmatically using methods of the MicroFour.StrataFrame.Security.Login class. 

Note: The reasoning behind the omission of a default login form or login form template is that each web-based login form is fundamentally different depending on requirements.  Also most login forms are not just login forms, but frames or regions within more complex forms.

Login Methods Used within a Web Application

The AuthenticateUser() and SetLoggedInUser() methods of the Login class are typically used to authenticating users within a web application:

Sample - Changing the Logged In User - Web Application [Visual Basic]
Imports MicroFour.StrataFrame.Security
...
Private Sub cmdLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handle cmdLogin.Click
    '-- Establish locals
    Dim loResult As Login.LoginResult
    
    '-- Attempt to authenticate the user
    loResult = Login.SetLoggedInUser(UserName, Password, "")
    '-- If the result if Success, AdminLoggedOn, or SecMaintUserLoggedOn, the
    '   SecurityBasics.CurrentUser object will be changed to the correct user
    
    '-- Do something based upon the result
    Select Case loResult
    Case Login.LoginResult.Success
    
    Case Login.LoginResult.Failure
    
    Case Login.LoginResult.UserDeactivated
    ...
    
    End Select
End Sub

Sample - Changing the Logged In User - Web Application [C#]
using MicroFour.StrataFrame.Security;
...
private void cmdLogin_Click(object sender, EventArgs e)
{
    //-- Establish locals
    Login.LoginResult loResult;
    
    //-- Attempt to authenticate the user
    loResult = Login.SetLoggedInUser(UserName, Password, "");
    //-- If the result if Success, AdminLoggedOn, or SecMaintUserLoggedOn, the
    //   SecurityBasics.CurrentUser object will be changed to the correct user
    
    //-- Do something based upon the result
    switch (loResult)
    {
        case Login.LoginResult.Success:
        
        case Login.LoginResult.Failure:
        
        case Login.LoginResult.UserDeactivated:
        
        ...
    }
}