Developer forum

Forum » Feature requests » Auto-login functionality in Extranet

Auto-login functionality in Extranet


Reply
Would be nice, if it was possible to setup, so that an Extranet user on login could mark "Auto-login" og "Remember login" - so that he does not need to login everytime.
It's possible on DW backend, and should also be possible in extranet module.

Replies

 
Nicolai Høeg Pedersen
Reply
What a nice idea...

Just implemented and it will be part of the next service release, 19.0.1.0, at the end of this month.

If save username and password is checked, and a new checkbox (name=autologin value=true) is also checked, Dynamicweb will create a cookie valid for 30 days with these information. When the user returns to the site (using same host and domain name) he will be logged in automatically and the cookie is renewed for another 30 days.

The autologin runs on first pageview - no matter if that page is protected or not.

To reset the autologin cookie allowing for another user to be able to login, call /Admin/Public/ExtranetLogoff.aspx.

Attached a template with a new checkbox for autologin.
 
Reply
Iaahhaaa...
That was quick. Hadn't expected that fast - and positive response.

Thanks...
Rune
 
Reply

Hi,

I tried to implement this but the tags are not parsed when I try to have the loginbox i a pagetemplate. Can it be done somehow?

Below is my versioninformation.

Regards / Aki


Content version 19.0.3.1 Assembly versions
Dynamicweb.dll 19.0.3.1
19.0.3.1 Dynamicweb, Version=18.9.1.1, Culture=neutral, PublicKeyToken=null
Dynamicweb.Admin.dll 19.0.3.1
Dynamicweb.Admin, Version=18.9.1.1, Culture=neutral, PublicKeyToken=null
Dynamicweb.Controls.dll 19.0.3.1
Dynamicweb.Controls, Version=18.9.1.1, Culture=neutral, PublicKeyToken=null 
 
 
Nicolai Høeg Pedersen
Reply
It is not page template tags.

On a page properties under security, you can choose a extranet login template - that is where it should be selected.

Where and how to set the template
http://manual.net.dynamicweb.dk/Default.aspx?ID=6646

And the tags
http://templates.dynamicweb.dk/TemplateTags/Dynamicweb-template-tags/Module-tags/Extranet/Intranet/Login.aspx
 
Reply

Yes thanks.

Is there any way to use the autologin functionality if you want have a login area on the page.  Like you have on this engage site?


/Aki

 
Nicolai Høeg Pedersen
Reply
Yes... Replace the extranet tags from extranet template to the global extranet tags...

DWExtranetUsername = Global:Extranet.UserName and so on.
 
Reply

Works for these:

<!--@Global:Extranet.Username-->
<!--@Global:Extranet.Password-->

But the ones required for autologin are not parsed.

<!--@Global:Extranet.UsernameRemember-->
<!--@Global:Extranet.PasswordRemember-->


/Aki


 
Nicolai Høeg Pedersen
Reply
No - they do not exist on the page template. But you do not need them anyways, so just delete them.
 
Reply
OK, I think I read somewhere that they were required to get the autologin to work. A bit simplified I have the below code for the login. Is it enough to have a checkbox named "autologin" to get it working. 
I have many users saying that it does not work.


<form id="ExtUserForm" name="ExtUserForm" method="post" Action="Default.aspx?ID=<!--@Global:Page.ID-->" onSubmit="return checkform();">
<table>
<tr>
<td><span id="UsernameText">Login : </span></td>
<td><input type="text"  name="Username"  value=""></td>
</tr>
<tr>
<td><span  name="ShowPasswordText">L&ouml;senord: </span></td>
<td ><input type="password"  id="ShowPasswordText"  name="Password"  value="">
<input id="SubmitButton" type="submit" value=" OK " /></td>
</tr>
<tr><td><input type="checkbox" value="True" name="autologin" id="autologin" />Autologin</td>                                                            
</tr>
</table>      
</form>
 
Nicolai Høeg Pedersen
Reply
You still need the remember username and password fields... Just not the template tag with the possible checked="checked" attribute...

You can also have them as hidden fields and set their value to true when autologin i checked.
 
Reply

OK, thanks for your help.

/Aki

 
Aki Ruuskanen
Reply

 I am tryin to accompish this in an other solution. Here is my code.

I have some javascript that sets the remeber username and password checkboxes.

    function setAutologinFields(v)
    {
      if (v==true)
      {
        document.forms.ExtUserForm.DWExtranetUsernameRemember.checked = true;        
        document.forms.ExtUserForm.DWExtranetPasswordRemember.checked = true;
}
    }


Then I have the HTML for the loginform:

<form id="login" name="ExtUserForm" action="Default.aspx" method="post" onSubmit="return checkform();">
<input type="hidden" name="ID" value="67" />
<label><span id="UsernameText">Användarnamn</span>
<input type="text" name="Username" id="username" value="<!--@Global:Extranet.UserName-->"></label>
<label><span style="display:;" id="ShowPasswordText">Lösenord</span>
<input type="password" name="Password" id="Password" value="<!--@Global:Extranet.Password-->"  /></label>
<a href="javascript:document.ExtUserForm.submit();">
<img name="loginbutton" id="loginbutton" border="0" src="/Files/Templates/Designs/NMParmen/images/LOGGA-IN.jpg"></a>
<br/>
<input type="checkbox" value="True" name="DWExtranetUsernameRemember" id="DWExtranetUsernameRemember">Kom ihåg användarnamn<br/>
<input type="checkbox" value="True" name="DWExtranetPasswordRemember" id="DWExtranetPasswordRemember" >Kom ihåg lösenord
<br/>
<input type="checkbox" onClick="setAutologinFields(this.checked)" value="True" name="autologin" id="autologin" /> Logga in automatiskt <br/>
<a href="Default.aspx?id=69">Glömt lösenordet?</a>                                          


The autologin does not work with the above code. I cannot figure out why?



Regards / Aki
 


 
 
Thomas Missmahl
Reply

Hey Nicolai,

 

What is the status and implementation of “Auto-login functionality in Extranet” from ”http://developer.dynamicweb-cms.com/forum/feature-requests/auto-login-functionality-in-extranet.aspx”..

 

I can not get the “Autologin/Remember login” to work

 

My code from the Templates/Extranet

 

<script language="JavaScript">

function checkform(){

if(document.ExtUserForm.Username.value.length <= 0){

alert('Angiv brugernavn');

document.ExtUserForm.Username.focus();

return false;

}

 

if(document.ExtUserForm.Password.value.length <= 0){

alert('Angiv kodeord');

document.ExtUserForm.Password.focus();

return false;

}

return true;

}

</script>

 

<div id="content">

<form name="ExtUserForm" method="post" Action="<!--@DWExtranetAction-->" onSubmit="return checkform();if (this.checker.checked) toMem(this)" id="login-form">

<p>Indtast brugernavn og kodeord...</p>

<p>

<label for="login-username">Brugernavn</label>

<input type="text" tabindex="1" name="Username" value="<!--@DWExtranetUsername-->" id="login-username" class="round full-width-input" autofocus />

<input type="checkbox" value="True" name="DWExtranetUsernameRemember" <!--@DWExtranetUsernameRemember-->>Husk brugernavn

</p>

 

<p>

<label for="login-password">Kodeord</label>

<input type="password" tabindex="2" name="Password" value="<!--@DWExtranetPassword-->" id="login-password" class="round full-width-input" />

<input type="checkbox" value="True" name="DWExtranetPasswordRemember" <!--@DWExtranetPasswordRemember-->>Husk kodeord

<br/>

<input type="checkbox" value="True" name="autologin" id="autologin">Autologin

</p>

<!-- <p>I've <a href="#">forgotten my password</a>.</p>-->

<input type="submit" tabindex="3" value=" LOG IN " class="button round blue image-right ic-right-arrow">

</form>

</div>

 

mvh

Thomas Missmahl

 
Anders Ebdrup
Reply

Hi Thomas,

 

I have implemented the autologin feature in Dw 8.1.2.8 with this:

        <form class="login-form" method="post" action="<!--@Global:Pageview.Url-->">
            <input type="hidden" name="ID" value="<!--@Global:Page.ID-->" />
            <input type="hidden" name="DWExtranetUsernameRemember" value="True" />
            <input type="hidden" name="DWExtranetPasswordRemember" value="True" />
            <input type="hidden" name="Autologin" value="True" />
            
            <div class="alert alert-block alert-warning in fade login-form-error" style="display:none;">
                <!--@Translate(SmartPage:User.Validate.Error, "Forkert brugernavn eller adgangskode")-->
            </div>

            <div class="control-group">
                <div class="controls">
                    <label for="login-username"><!--@Translate(SmartPage:User.Login.Username, "Indtast e-mailadresse/brugernavn")--></label>
                    <input type="text" id="login-username" class="login-credentials login-username-field" name="username" spellcheck="false" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <label for="login-password"><!--@Translate(SmartPage:User.Login.Password, "Indtast adgangskode")--></label>
                    <input type="password" id="login-password" class="login-credentials login-password-field" name="password" />
                </div>
            </div>
            <button type="submit" class="btn btn-primary btn-large pull-right" data-loading-text="Loading..."><!--@Translate(SmartPage:User.Login.Button, "Go!")--></button>
        </form>

Hope this will help you

 
Oleg Rodionov
Reply

Hi all,

I've just checked the feature on last DW (8.2.3.0) using ability described at NP's post above (13/10/2009) with the template provided and have good results - the functionality works properly, except one issue found  -  expiration date for Extranet autologin cookie does not follow the MC setting (new TFS 12190 has been submitted)

BR, Oleg