MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

By Pass the User Authentication on Web Page (Closed) (Mono Support )

Viewed 108586 time(s), 17 post(s) 10/12/2011 11:49:36 AMby ashutosh0901

Related topics

ashutosh0901

ashutosh0901

10/12/2011 11:49:36 AM
I want to by pass the user authentication page which is Login.aspx though my page..where user is already providing username and password.
This content has not been rated yet. 
353 Reputation 46 Total posts
imarusic

imarusic

10/12/2011 12:13:53 PM
If I understood correctly you have created your own login page and you want your page to be rendered when an user clicks on login link?

Regards
Rated 4.50, 2 vote(s). 
3016 Reputation 428 Total posts
ashutosh0901

ashutosh0901

10/12/2011 12:31:10 PM
No, i have created a page which carry username and password in a session variable from my page to your login page , now i want that your login page should take the my session value without asking for the credentials and redirect to the page which comes after we login to your login page.....

This content has not been rated yet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

10/12/2011 12:42:05 PM
Please reply its urgent
This content has not been rated yet. 
353 Reputation 46 Total posts
imarusic

imarusic

10/12/2011 1:13:43 PM
You need to add some code to login page so here are the necessary steps:

1. First you need to retrieve your username and password from session on Login page. You can add all the code in Login.aspx .cs. to it's load method.
2. Use below code snippet to validate user

Membership.ValidateUser(username, password);

3. Then use this code snippet:

FormsAuthentication.SetAuthCookie(username, true);

4. And redirect user:

ctlLogin.RedirectAfterLogin();

Regards
Rated 5.00, 2 vote(s). 
3016 Reputation 428 Total posts
ashutosh0901

ashutosh0901

10/12/2011 1:41:24 PM
Thank you so much for your valuable time. It certainly solved my problem
This content has not been rated yet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

10/12/2011 2:06:34 PM
Membership.ValidateUser(username, password);
FormsAuthentication.SetAuthCookie(username, true);
ctlLogin.RedirectAfterLogin();

i used these codes on login.aspx page , now when i run the application it is always loggin as administrator even if the person is having user roleid
This content has not been rated yet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

10/12/2011 2:50:21 PM
Please reply
This content has not been rated yet. 
353 Reputation 46 Total posts
denis

denis

10/12/2011 3:07:50 PM
We cannot reproduce this behavior. If you pass the correct username to the SetAuthCookie method, it should work as expected. Could you check that the user data that you store in the session store is correct?
This content has not been rated yet. 
7207 Reputation 956 Total posts
ashutosh0901

ashutosh0901

10/12/2011 4:12:26 PM
My only motive is not to show login.aspx or login panel used in the login.aspx when user come through my page , user should directly gets signed in and when he click on logout it show come back to my page.

but currently it is getting logged in but when i refresh the login.aspx page and that textboxes are visible
This content has not been rated yet. 
353 Reputation 46 Total posts
1 2