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 (Zatvorena) (Mono Support )

114122 put(a) pogledan, 17 odgovor(a) 12.10.2011. 11:49:36Kreirao(la) ashutosh0901

Povezane teme

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.
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
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
Ocjena 4,50, 2 glas(ova). 
3016 Reputacija 428 Ukupno objava
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.....

Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
ashutosh0901

ashutosh0901

12.10.2011. 12:42:05
Please reply its urgent
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
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
Ocjena 5,00, 2 glas(ova). 
3016 Reputacija 428 Ukupno objava
ashutosh0901

ashutosh0901

12.10.2011. 13:41:24
Thank you so much for your valuable time. It certainly solved my problem
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
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
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
ashutosh0901

ashutosh0901

12.10.2011. 14:50:21
Please reply
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
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?
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
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
Ovaj sadržaj još nije ocijenjen. 
353 Reputacija 46 Ukupno objava
1 2