C1 3.2: Create Custom Login Screens

Topics: Standard packages
May 9, 2012 at 2:15 PM

Per C1 3.2 announcement there's a feature for "Creating custom login screens" but no reference to documentation for implementing this feature.

Can someone post a reply to the documentation URI or explain this feature in sufficient detail to implement.

May 23, 2012 at 12:21 PM

Kevin, sorry for the long delay.

The "Creating custom login screens" feature description is slightly simplified - what we have done is to make the part of the system which check if a user is validated pluggable. With that, you can for instance write a small plug-in which rely on Active Directory or certificate validation and hence avoid users accessing the C1 COnsole ever get the login box.

We haven't documented this very well yet, but here a few pointers:

  • You need to create a plug-in which implement Composite.C1Console.Security.Plugins.LoginSessionStore.ILoginSessionStore
  • You can see the default implementation of ILoginSessionStore if you download the source doe and look at the class Composite.Plugins.Security.LoginSessionStores.HttpContextBasedLoginSessionStore.HttpContextBasedLoginSessionStore
  • You register your plugin by editing ~/App_Data/Composite/Composite.config and adding your stuff to this area:
      <Composite.C1Console.Security.Plugins.LoginSessionStoreConfiguration defaultProvider="AspNet">
          <add name="AspNet" type="Composite.Plugins.Security.LoginSessionStores.HttpContextBasedLoginSessionStore.HttpContextBasedLoginSessionStore, Composite" />
  • If you configure IIS or similar to force AD validation (or the type af validation you need), simply return the user name on ILoginSessionStore.StoredUsername

Please feel free to ask questions here and I'll be more responsive the next time around.

May 6, 2013 at 7:48 AM
Edited May 6, 2013 at 7:49 AM
I have implemented a usercontrol for login screen and put on the header so someone can tell me how can i use that control for login into c1 as admin/editor..
May 6, 2013 at 8:09 AM
You can do something like this:
using Composite.C1Console.Security;
bool validLogin = UserValidationFacade.FormValidateUser(userName, password);
May 6, 2013 at 10:48 AM
Code is not working...can you please suggest any other solution along with steps.

Thanks in advance
May 6, 2013 at 12:56 PM
Can you shortly describe your code, what result you get and what you expected?
May 7, 2013 at 7:00 AM
See HTML Code
<form action="" method="get" id="loginform"> <table> <tr><td>User Name</td></tr><tr><td><input type="text" class="textbox" name="loginid" placeholder="User Name"/></td></tr> <tr><td>Password</td></tr><tr><td><input type="text" class="textbox" name="logipass" placeholder="***********"/></td></tr> <tr><td><input type="submit" name="login" class="button" value="Entrar >"/></td></tr> </table> </form> i want when user click on enter button then it will redirect to ~/Composite/top.aspx page after validating user.
May 7, 2013 at 7:28 AM
Thanks it is done........
May 7, 2013 at 8:06 AM
I have inserted two usercontrol form in front page but i am getting error

Multiple <asp:form /> elements exists on this page. ASP.NET only support one form. To fix this, insert a <asp:form> ... </asp:form> section in your template that spans all controls.
May 7, 2013 at 8:50 AM
If you are using Master Pages for templates you should add <form runat="server" /> around the place holders on your page.

If you are using another template type (Razor or XML) you should wrap <asp:form xmlns:asp="http://www.composite.net/ns/asp.net/controls" /> around your content.

See http://docs.composite.net/ASP-NET/Web-Forms/Form
May 7, 2013 at 10:16 AM
Its done.