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 114908 time(s), 17 post(s) 12.10.2011 11:49:36by ashutosh0901

Related topics

ashutosh0901

ashutosh0901

12.10.2011 11:49:36
I want to by pass the user authentication page which is Login.aspx though my page..where user is already providing username and password.
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
imarusic

imarusic

12.10.2011 12:13:53
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
Bewertet mit 4,50, 2 Besucher. 
3016 Reputation 428 Total posts
ashutosh0901

ashutosh0901

12.10.2011 12:31:10
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.....

Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

12.10.2011 12:42:05
Please reply its urgent
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
imarusic

imarusic

12.10.2011 13:13:43
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
Bewertet mit 5,00, 2 Besucher. 
3016 Reputation 428 Total posts
ashutosh0901

ashutosh0901

12.10.2011 13:41:24
Thank you so much for your valuable time. It certainly solved my problem
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

12.10.2011 14:06:34
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
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

12.10.2011 14:50:21
Please reply
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
denis

denis

12.10.2011 15:07:50
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?
Dieser Inhalt wurde noch nicht bewertet. 
7207 Reputation 956 Total posts
ashutosh0901

ashutosh0901

12.10.2011 16:12:26
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
Dieser Inhalt wurde noch nicht bewertet. 
353 Reputation 46 Total posts
1 2