+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Wiki URL Access

Wiki URL Access

4 posts, 0 answered
  1. Steve
    Steve avatar
    11 posts
    Registered:
    18 Dec 2008
    18 Sep 2009
    Link to this post

    We are going to deploy the SF Wiki as our online community help system for our product.  In the beginning we only want site registered users to have access to view the Wiki, so we need to pass login credentials from our application.  For example here is an example of a URL call that our application would use to access the Wiki for hits on 'purchasing'. 

    http://www.ourSFsite.com/sitename/Help/Search.aspx?IndexCatalogue=helpsearchindex&SearchQuery=purchasing

    The only problem is that we deny anonymous view to the Wiki.  What URL mechanism exists that would support passing user identification to the Wiki to allow our application to call the Wiki with view permission?

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    24 Sep 2009
    Link to this post
    Hi Steve,

    Thank you for your question.

    Usually you can use the following code to log a user automatically in the application:
    var userManager = new Telerik.Security.UserManager();   
    FormsAuthentication.SetAuthCookie("manager"true);   
    var aCookie = FormsAuthentication.GetAuthCookie("manager"true);   
    UserManager.Default.SetAuthenticationCookie(aCookie);   
     

    So you can pass a username for example in the in query string. Of course this will not be enough - it posses security risk. Therefore you can pass the Login token of the user, which is:

    string utoken = GetToken(username, password);

    If you have a table with the usernames and the tokens, you can pass the token and the username, and then on the wikipage code behind you can login the user if the token is the same.

    I hope this sounds as a solution.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Steve
    Steve avatar
    11 posts
    Registered:
    18 Dec 2008
    23 Oct 2009
    Link to this post
    Georgi - can you send two example URLs based upon the URL example I provided in the original thread; the first showing sending the WIKI username and password as part of the URL call, the second showing the URL call referencing only the TOKEN idea you have provided. 

    We are not an ASP product, we are a .Net Smart client that calls open the browser with a specific URL call, based upon the activity open in our smart client.  Here is what I was hoping to accomplish:

    1:  Create a Read-Only Wiki View Login in SF (Done)
    2:  Get SF to provide for us a "token" of that login and password (Not Done)
    3:  Embed into our Application a URL something like this - http://www.ourSFsite.com/sitename/Help/Search.aspx?IndexCatalogue=helpsearchindex&SearchQuery=purchasing&token=38nd98y3n38976h3

    Our assumption is that the browser would pass this call to SF, SF parses the URL, logs in the user based upon a valid token, and "ta da" the WIKI search list is displayed.

    Your guideance is appreciated.  Steve
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Oct 2009
    Link to this post
    Hi Steve,

    Thank you for getting back to us.

    Here is what you do in steps 2 and 3:

    2) Each membership user has a ProviderKey that is unique for this user. You can get this key with the following lines:
    MembershipUser user = userManager.GetUser("manager");
    string userKey = user.ProviderUserKey.ToString();

    Once you have taken the key for this user you can set up a URL rewrite for the wiki search page to append a query string named token for example with the value of this key. For more information on URL rewrites, please take a look at the following webinar.

    3) As Georgi has mentioned you can put some logic in the Page_Load event of the wiki page to check query string for key with name token and retrieve it:
    void Page_Load(object sender, EventArgs e)
    {
        string[] userKeys = HttpContext.Current.Request.QueryString.GetValues("token");
        if (userKeys != null)
        {
            Guid userKey = new Guid(userKeys[0]);
            UserManager userManager = new UserManager(Membership.Provider.Name);
            MembershipUser user = userManager.GetUser(userKey);
            FormsAuthentication.SetAuthCookie(user.UserName, true);
            var aCookie = FormsAuthentication.GetAuthCookie(user.UserName, true);
            userManager.SetAuthenticationCookie(aCookie);
        }
    }

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered