This topic is locked
[SOLVED]

 Login URL?

1/9/2020 3:16:18 PM
ASPRunner.NET General questions
Pete K author

I could have sworn I read somewhere (manual, forum, or blog) where at some point functionality was added to allow a user to access an app and login via a single URL containing the encoded username and password. But I have searched all over the place and can't find any reference to that now. Did I dream this, or is it just incredibly difficult to find?

N
Nir Frumer 1/9/2020

https://xlinesoft.com/blog/2019/10/03/saas-application-design/
hi I believe that you refer tos this one.
Nir.

Pete K author 1/10/2020



https://xlinesoft.co...ication-design/


Hi. Thanks for the reply, but no -- that is not what I'm asking about. This has nothing to do with multi-tenancy. All I am asking about is one link to pass the authentication info and log the user in. I'm sure I saw a post about that somewhere recently.

Pete K author 1/10/2020

Figured out a way to do this by adding the following code to the BeforeProcessLogin() event of the login page.

//Check to see if username and password were passed in the querystring and if so, log user in and redirect to ballot page
string password = MVCFunctions.postvalue("password");

string username = MVCFunctions.postvalue("username");
if (Security.checkUsernamePassword(username, password, false))

{

Security.loginAs(username, false);

MVCFunctions.HeaderRedirect("Ballots", "list");

}


admin 1/14/2020

Here is the link:

https://asprunner.com/forums/topic/26606-auto-login-passing-username-and-password-via-url/
This is the second post in Tips and Tricks forum.

Pete K author 1/15/2020



Here is the link:

https://asprunner.co...ssword-via-url/
This is the second post in Tips and Tricks forum.


Thanks, Sergey. I knew I had seen it somewhere. Looks like I came up with pretty much the same code.