Has anyone managed to get ASP.NET Forms Authentication (with cookies) working with a PhoneGap based mobile application?
I have come across the following questions about managing cookies within PhoneGap and configuring the server properly:
But unfortunately neither of these solutions work. The requests coming from a PhoneGap application do not indicate an authenticated user even though when I run the same dashboard.html code as a file in Safari the requests show up as authenticated.
config file to implement the authentication of web application. Here we add Forms authentication mode and loginUrl is my login page where we create our login form and we also assign two users for authentication which is hard coded. So only two users by this name can authenticate our application page.
Forms authentication enables user and password validation for Web applications that do not require Windows authentication. With forms authentication, user information is stored in an external data source, such as a Membership database, or in the configuration file for an application.
ASP.NET supports Forms Authentication, Passport Authentication, and Windows authentication providers. The mode is set to one of the authentication modes: Windows, Forms, Passport, or None. The default is Windows. If the mode is None, ASP.NET does not apply any additional authentication to the request.
cookieless="UseCookies"
in web.config FINALLY did it for me:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" cookieless="UseCookies" />
</authentication>
REF: https://groups.google.com/forum/?fromgroups#!topic/phonegap/Thj0fS2GDh4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With