0

So I have a Lemoon site, and I am trying to have a page that is "hidden" to everyone, except if they enter a known url - in which case they would be prompted to enter a shared user/pass to view the "hidden" page.

I see in the Lemoon documentation they make reference to a User service API - however it doesn't really mention anything on integrating it with your current app. Here is the reference:http://www.lemoon.com/developers/programming/api/services/user-service

Anyone have any ideas on where to place the code in Example #2 in order to get auth working? Cheers!

cardiac7
  • 491
  • 1
  • 9
  • 26

1 Answers1

0

I don't know that much about Lemoon - but from a quick look its a ASP.NET web forms web application with forms based authentications. You could either put you new page in the "Admin" folder, or to use the UserService directly you'd add the code to a button click event:

        protected void login_Click(object sender, EventArgs e)
    {
        var user = UserService.Authenticate(username.Text, password.Text);

        if (user != null)
        {
            message.InnerHtml = String.Format("Welcome {0}", user.Name);
            FormsAuthentication.SetAuthCookie(user.Username, false);
            Response.Redirect(ContentHelper.ResolveUrl(Content, false), false);
        }
        else
        {
            message.InnerHtml = "Incorrect username and password";
        }
    }

You'll need to add the following using statement to access the services:

using Mindroute.Core.Services;
Keir
  • 483
  • 3
  • 10