Conduit API
Case Study
Case Study -> Personal App -> User Login
 
In this section you will learn how to create a login component for the "Date Me" site.
User login can be implemented in one of two ways:
1. Gadget login: log in directly through the toolbar (demostrated here).
2. Site login: redirect to your website login page.
 
Gadget login
 
 
1. On the HTML component, add client side onclick event to the login button. onclick="OpenFloatingWindow(LOGIN_FORM_URL)"
2. Implement a login form on your website which will be used as the gadget window source.
3. Implement the server side login onclick event button in the gadget login form. Use same user credentials validation logic as implemented in your website.
3.1. If validation failed, reload the gadget login form with a suitable error message.
3.2. If validation succeeded, use java script to refresh the toolbar and close the gadget login window.
 
Before Login:


After Login:
 
Flow chart:
 
Site login
 
Logout:
 
1. On the HTML component add client side onclick event to the logout button and use Ajax to invoke logout through server side handler (See code sample section for server side handler implementation).
2. Use java script to refresh the toolbar.
 
 
'Date Me' login button on the HTML component (personal data component)
 
'Date Me' login gadget window form aspx file
 
'Date Me' login gadget window form aspx.cs file
 
'Date Me' logout handler ashx file