Auto login with UID and PWD from URL

215 views
Skip to first unread message

Krishnam

unread,
Jan 25, 2011, 8:29:14 AM1/25/11
to ResourceSpace
Hi all,

Need auto login help through ReturnURL.

I am passing User ID and Password from a URL to ResourceSpace login
page from another page in which I am already logged in.

http://102.168.0.10/KrisDAM/login.php?ReturnUrl=Default.aspx&username=<UserField:emailUsername>&password=<UserField:emailPassword>

On the Login page its inserting the User Name from the ReturnUrl value
but its not inserting the Password also its not logging in to RS site.


Please advice.


Thanks and regards,
Krishnam

Tom Gleason

unread,
Jan 25, 2011, 10:06:53 AM1/25/11
to resour...@googlegroups.com
That's because RS doesn't support sending username and password through the url.

you could add a value getter in line 230 of login.php,

<input type="password" name="password" id="password" class="stdwidth" value="<?php echo getval("password",'') ?>" <?php if (!$login_autocomplete) { ?>AUTOCOMPLETE="OFF"<?php } ?> />

but, it's not secure to be sending passwords in plain text in urls.
> --
> You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
> To post to this group, send email to resour...@googlegroups.com.
> To unsubscribe from this group, send email to resourcespac...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/resourcespace?hl=en.
>
>



--
Tom Gleason, PHP Developer

Exploring ResourceSpace at:
http://resourcespace.blogspot.com

ResourceSpace Support Services
https://www.buildadam.com/muse2

Krishnam

unread,
Feb 8, 2011, 11:34:07 AM2/8/11
to ResourceSpace
Hi Tom,

Thanks for the solution.

As per your solution I modified the lines to

<input type="password" name="password" id="password" class="stdwidth"
value="<?php echo getval("password",'') ?>"
<?php if (!$login_autocomplete) { ?>AUTOCOMPLETE="OFF"<?php } ?> />

And then I passed the UID and Password in URL as below:

http://102.168.0.10/KrisDAM/login.php?username=City&password=C1tyL0n

It does insert the User Name and Password in respective text boxes but
it doesn't login automatically to DAM home page.

I had to press Login button.

Please help me to login to home page with out pressing Login button.




On Jan 25, 8:06 pm, Tom Gleason <t...@buildadam.com> wrote:
> That's because RS doesn't support sending username and password through the
> url.
>
> you could add a value getter in line 230 of login.php,
>
> <input type="password" name="password" id="password"
> class="stdwidth"*value="<?php echo getval("password",'') ?>"
> * <?php if (!$login_autocomplete) { ?>AUTOCOMPLETE="OFF"<?php } ?> />
>
> but, it's not secure to be sending passwords in plain text in urls.
>
> On Tue, Jan 25, 2011 at 8:29 AM, Krishnam <krishnam.vi...@gmail.com> wrote:
> > Hi all,
>
> > Need auto login help through ReturnURL.
>
> > I am passing User ID and Password from a URL to ResourceSpace login
> > page from another page in which I am already logged in.
>
> >http://102.168.0.10/KrisDAM/login.php?ReturnUrl=Default.aspx&username=
>
> <UserField:emailUsername>&password=<UserField:emailPassword>
>
> > On the Login page its inserting the User Name from the ReturnUrl value
> > but its not inserting the Password also its not logging in to RS site.
>
> > Please advice.
>
> > Thanks and regards,
> > Krishnam
>
> > --
> > You received this message because you are subscribed to the Google Groups
>
> "ResourceSpace" group.> To post to this group, send email to resour...@googlegroups.com.
> > To unsubscribe from this group, send email to
>
> resourcespac...@googlegroups.com<resourcespace%2Bunsubscribe@goog legroups.com>
> .> For more options, visit this group at

Tom Gleason

unread,
Feb 8, 2011, 2:28:35 PM2/8/11
to resour...@googlegroups.com
you could add this above the last lines in login.php:

if (getval("autologin","")){?><script
type="text/javascript">document.forms["loginform"].submit();</script><?php
}


right above:
include "include/footer.php";

?>

and then pass an autologin=true parameter

http://localhost/resourcespace/login.php?username=admin&password=admin&autologin=true

> To unsubscribe from this group, send email to resourcespac...@googlegroups.com.

Krishnam

unread,
Feb 8, 2011, 2:54:49 PM2/8/11
to ResourceSpace
You are Amazing Tom.

Thanks a lot for all the help.

Cheers!
Krishnam

On Feb 9, 12:28 am, Tom Gleason <t...@buildadam.com> wrote:
> you could add this above the last lines in login.php:
>
> if (getval("autologin","")){?><script
> type="text/javascript">document.forms["loginform"].submit();</script><?php
>
> }
>
> right above:
> include "include/footer.php";
>
> ?>
>
> and then pass an autologin=true parameter
>
> http://localhost/resourcespace/login.php?username=admin&password=admi...
> > For more options, visit this group athttp://groups.google.com/group/resourcespace?hl=en.

Tom Gleason

unread,
Feb 8, 2011, 3:08:41 PM2/8/11
to resour...@googlegroups.com
You probably need to refine this a bit to prevent a looping scenario
that would crash the browser if the login information is wrong:

if (getval("autologin","")!=""&!isset($valid)){?><script


type="text/javascript">document.forms["loginform"].submit();</script><?php
}

Krishnam

unread,
Feb 18, 2011, 8:44:47 AM2/18/11
to ResourceSpace
Thanks a lot Tom.

Yes, with the enhancement the page was refreshing in a loop.

Now its tine.

Thanks and regards,
Krishnam

On Feb 9, 1:08 am, Tom Gleason <t...@buildadam.com> wrote:
> You probably need to refine this a bit to prevent a looping scenario
> that would crash the browser if the login information is wrong:
>
> if (getval("autologin","")!=""&!isset($valid)){?><script
> type="text/javascript">document.forms["loginform"].submit();</script><?php
>
>
>
>
>
>
>
>
>
> }
> On Tue, Feb 8, 2011 at 2:54 PM, Krishnam <krishnam.vi...@gmail.com> wrote:
> > You are Amazing Tom.
>
> > Thanks a lot for all the help.
>
> > Cheers!
> > Krishnam
>
> > On Feb 9, 12:28 am, Tom Gleason <t...@buildadam.com> wrote:
> >> you could add this above the last lines in login.php:
>
> >> if (getval("autologin","")){?><script
> >> type="text/javascript">document.forms["loginform"].submit();</script><?php
>
> >> }
>
> >> right above:
> >> include "include/footer.php";
>
> >> ?>
>
> >> and then pass anautologin=true parameter
Reply all
Reply to author
Forward
0 new messages