473,382 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Authenticating user through more than one login page for mobile part of webpage, C#

Hi,

I'm currently working on creating a stripped down part of a company web page, that will be accessed from cellphone. The problem I have is that the Windows Forms authentication makes it difficult for me to create more than one login page. In my web.config file I have it set so that unauthenticated users will be directed to the default.aspx page which handles logging in. As part of the default.aspx Page_Load I transfer users to a mobile/login.aspx page in case the browser.IsMobile is true.
However, before my login code in mobile/login can be executed, the forms authentication detects that I'm not logged in, and redirects me back to default.aspx, which in turn redirects me to mobile/login.

I have thought of several possible ways to solve this, but I haven't found any good information on it.

One way would be if it is possible to specify multiple login pages in the web.config file that would prevent default.aspx to load if I'm accessing the mobile login page. Can this be done?

Another thought was to make the default.aspx into both desktop and mobile login, by mixing asp: and mobile: content. Does anyone know if this is possible? Is it possible to have both a mobile:Form and an asp:content, the compiler seemed to dislike the idea. This would also require that I created a filter or devicefilter that detected all mobile devices and checked against it at the start of the default HTML code. Is there a clean way to do this or would I have to create a separate check with the compare argument against every brand and type of cellphone?

Best,

Erik
Aug 24 '07 #1
3 2516
kenobewan
4,871 Expert 4TB
Why wouldn't you have browser check in in your default page_load and redirect if browser.IsMobile true?
Aug 24 '07 #2
Why wouldn't you have browser check in in your default page_load and redirect if browser.IsMobile true?
The redirection works alright, but it still doesn't allow me to sign in through the mobile login when I'm using a cellphone emulator. The problem is that once I've attempted to login, I'm still directed back to the orignal login page withough authentication. I've fixed better redirection by using <location > tags in my web.config where I allow all users to access the mobile login. However, the problem still persists. At the end of my Authentication method, I add an auth cookie and a user preference cookie to the Response Cookie list, for a total of three cookies. I then redirect the user to the page they want to see, in this case mobile/home.aspx. However, after the Redirect, the two cookies are somehow deleted and since no auth cookie exist the browser defaults back to default.aspx once again. Does this behavior sound familiar? I'm using the latest OpenWave simulator and I've checked so that it accepts cookies, so that shouldn't be the problem.

Thanks,

Erik
Aug 24 '07 #3
I've tracked the problem a little further, and it seems that when the Application_AuthenticateRequest is called in Global.asax.cs, the cookies are all gone, and there is no HttpContext.Current.User object, which there should be. Does this mean anything to anyone? Could it be some mobile specific thing?
Aug 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Sophia | last post by:
I need to authenticate users to enter in a NTLM-protected virtual directory, but I can't pop up a NT-login dialogue box - I can only do a web-based username/password form (my client is a...
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
1
by: Larry Rekow | last post by:
I created a web application in classic ASP 6 months ago that had a login page which would only allow certain users to add, update or delete files from 6 different departments. (Windows 2000 server,...
4
by: Brent Waldrop | last post by:
Ok everyone, i have been pulling my hair out on this one. I have been working on it for 3 days with no sucess. This problem is occuring at home where i am running a workgroup. I have Windows 2003...
2
by: H | last post by:
I have designed a C# application that will populate a database with customer information and email a randomly generated password to them. I would like them to have the ability to update their...
4
by: SJ | last post by:
I have a mobile web application running on a server at work. There is a strange thing happening though: 1) I can access and login to my mobile web app from any internet browser. (good thing). 2)...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
4
by: Nick | last post by:
Hi there, I have a website setup which uses the ASP.net login controls to manage user sessions. I would like to be able to login a user through a webservice situated on the same server. ...
5
by: Manikrag | last post by:
Hi Team, I have copied one ASP.NET application on a new server and configured it all.Now I am getting below error when I am trying to authenticate users thru LdapAuthentication function. This...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.