none
signout functionality in SharePoint

    Question

  • Hi,

    How I can add my logout button in SharePoint. I want separate button and don't want to use welcome menu functionality.

    Can I add a button and on click redirect to logout page?

    Thanks
    AllTec
    Friday, September 19, 2008 3:59 AM

Answers

All replies

  • Hi ,

    If you have logout functionality. You need to add code in master page. Add a link button in master page with name SignOut and in onclick event give the link as "/_layouts/Signout.aspx"


    I thinks it will help you

    sree
    Friday, September 19, 2008 4:37 AM
  • If you want it in the Site Actions menu and as a feature, here you go:  http://www.thesug.org/blogs/lsuslinky/Lists/Posts/ViewPost.aspx?ID=23



    Tim

    Friday, September 19, 2008 12:38 PM
  • Hi

    Solution code:


             if (HttpContext.Current.User.Identity.AuthenticationType.ToUpper() != "FORMS")
             {
                            FormsAuthentication.SignOut();
                            FormsAuthentication.RedirectToLoginPage();
             }
             else
             {
                            HttpContext.Current.Response.Redirect("/_layouts/Signout.aspx");
             }

     

    To understand the meaning behind the solution you can read the following text :

    There are three main methods of authentication

    1)   Windows Authentication which has two main methods:
     

    NTLM : Challenge- Response mechanism Where the client sends user name to the server ; server replies by sending challenge to the client. The client then encrypt that challenge using  the user’s password and sends response to the server. The server validate the response by searching through the security Account Manager. if the it is domain user account; the server sends  response to domain controller for validating and retrieving group policy , create token and open session for the user.

     Kerberos : Trust-Third-Party Scheme.User log on it requests Ticket Grant Ticket (TGT) from the authentication service in the users domain; when user want to access network resources; it presents TGT and server principal name (SPN) to the target server once authenticated by the target server this later create an access token for the client user.

    2)   Anonymous Access : all end users have access
    3)   Form based Authentication: based on AD or ADLDS users

    Cheers


    Mohamed Hachem
    Monday, July 12, 2010 8:41 PM