Forum Discussion

rizalvi's avatar
rizalvi
Mentor
12 years ago

SSO via Sharepoint server

Hi,

We are trying to do Single Sign-on for our employees. So we have internal SharePoint site where all employees sign-on. The idea is once an employee sign on to Sharepoint it should generate a cookie and that will be passed on to Lithium. That cookie will be decoded on Lithium side and will be allowed in without inputting user ID and password.

We are looking for a .Net code that can be put on to SHarePoint server. So we don't know what the code should look like and also don't know where it should be installed.

If anyone has done this before, please help.

Thanks

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)

    Hi rizalvi 

     

    there are basically 3 ways to write a Lithium cookie.

    • use Lithium library to create the cookie object and write the cookie object to response.
    • use Lithium library to create the cookie object, but write the cookie object to response yourself.
    • use Lithium library to generate the cookie content, but create the cookie object yourself and write the cookie object to response yourself

     

    for the first way, this could be some sample code for you

    // init SSOClient class (to be called during server init, 1 time only)
    String keyPath = "C:\\usr\\local\\www\\web-inf\\lithium\\companyx.key";
    SSOClient.init(keyPath, "companyx", ".companyx.com");
    
    .......
    .......
    
    String uniqueId = "167865";
    
    // display name
    String login = "janmon04";
    
    String email = "jane.monet@mycompany.com";
    
    Hashtable settingsMap = new Hashtable(); 
    settingsMap.Add("profile.name_first", "Jane");
    settingsMap.Add("profile.name_last", "Monet");
    
    //write cookie
    //request and response should be your content value
    SSOClient.writeLithiumCookie(uniqueId, login, email, settingsMap, request, response);