Security - Console Application With .NET Authentication
Jan 5, 2011
Here's the situation, I've got a console application that needs to run once a day and make a few requests to pages that require authentication to view. The pages are hosted in a really basic ASP.Net Web Application.
So, I know that in order for the requests to go through successfully I have to authenticate with the server. So I've hooked up the console application to the ASP.Net Membership Provider I'm using for the web app and it successfully determines if a set of a credentials are valid. However, after calling Membership.ValidateUser() any requests I make just get the login screen. After doing some reading it seems that this is because I'm missing the important cookie information that persists my login or what-have-you.
I'm using a basic WebClient to make the requests and then reading/discarding the result.
So the meat of the question is this: Is there a simple way to validate the login information and hold on to it so that I can make the requests successfully, or is this the exact same case as the other two questions I found that require the WebClient to make a "manual" login request to the login.aspx page and try to hold on to the cookie from there?
The questions I'm referencing are:
Authenticating ASP.NET MVC user from a WPF application and Login to website and use cookie to get source for another page
We are using membership provider for LDAP authentication. It is working as it should.
But what all configuration settings I have to do so that all the future requests to this application run under the security context of the Logged in user account not through the some default user set in IIS.
We need to have this working because all the permissions on the database are based on the logged in user.
We are using form authentication for LDAP authentication. And having impersonation = true in web.config.
I have seen some articles about different types of authentication in online. But i have not used any thing particular.I build a web application that user can register and login an after that.In that application when the user comes to loginpage and enter the user name and password and on click of the login button,the validation is done against the data in DataBase. So i am not getting the any idea of form level authentication with the user details in the webconfig file. For what type of applications we use this type of authentication. Can anybody help to get an idea about this authentication.
I have a web.config file defined in my asp.net web application. I have many different settings configured there. I have another project, this time a console application. I'd like to read several configurations from my web.config file. How can this be done?
I have an application which has a website and a project. The project contains an executable file which I'm trying to run as a process from the website's Global.asax file's application_start(). When I run this application from localhost, everything runs smoothly but when I deploy the application on IIS, application_start's code is executed and I can see the process name in the taskmanager but I cannot see the window which the console application normally starts in (when i run the application on localhost) and neither is the code executed.
Here's what I'm doing:
-- copied website and project in wwwroot -- made a virtual directory of the website -- when i run the website, I see the process in taskmanager but the code is not executed.
I am new to deployment and IIS, and would really appreciate I someone could tell me what i'm missing
Has Passport authentication been removed from ASP.NET 4? It doesn't appear in the documentation anymore, I can't find the site to download it... It seems like Windows Live ID is replacing it, is it correct?
I have authentication in my web application. I want the application to be logged in with the same credentials as of system logged in. Am able to compare the username easily, but don't know how i can compare the textbox content with logged in windows password. Am using .NET 3.5.
I am developing a web application which requires user to login. There will be N number of users using website concurrently. We have a MySQL database which will store user information like Name, User ID, Password etc. I am not able to understand on how to check username and password once they enter data using Login form which will be present in DB.
I've a project using windows authentication and it will be used in intranet. The client itself already have a web application in their intranet and they built it with Java (they used windows authentication too). The problem occur when they want my web application only appear within their application content section.
What should I do? I did think about using iframe but some people said it's evil. And if I'm going to use iframe, is it save? My web application will use a few pop up window/modal window and ajax.
I am using Windows Integrated Authentication with impersonation for all my web applications (on IIS 7 and 7.5), and everything is perfect.
Now I would like to enhance the authentication procedures bypassing the login prompt from IIS, and supplying a custom page to collect the Username + Password inputs from Users, but still mantaining the Windows Authentication support (I rely on the WindowsPrincipal in my application for many core activities).
I just would like to replace the IIS popup with my custom authentication page.
First of all I have tried to mix the WIA with Forms Authentication, but - even if I succeed in authenticating users against the Active Directory - the result is not what I was looking for, because I want to mantain Windows Authentication and not migrating the mechanism to Forms Authentication (even if implemented with the AD provider).
The first step I am trying is to use the "LogonUser" function to create the correct WindowsPrincipal and then the "Impersonate" method, but after this step I have no idea about how to persist the authentication data andor to pass the User information to the Windows Authentication. As a result, when I execute the first redirection to another page the information about the user manually logged are lost.
I would like to add this feature to my web application, for the end users to chose the type of the authentication either (windows) or (Forms), and add it in the admin setting. This can be done by changing the authentication type programmatically in the code. how can I do this? Note: The user can use one type at time only.
I've encountered a problem with intranet ASP.NET Application using AD Form Authentcation. The login and authorization is built using this KB http://support.microsoft.com/kb/316748. It works fine on DEV but not in UAT and PROD.
Basically, the problem is:1. In DEV, users see login page and they enter domain user name and password and login process happens with no issue.
2. But in PROD and UAT, the same application when the users see the login page (first time) and they submit the login form no response. The login button does nothing. The user closes the browser and come back to login page and it works second time. Strange, this doesn't happen in DEV.
3. Further, on DEV by changing the LDAP path to PROD or UAT, the users can still login the first time. It's only the PROd and UAT that seems to be a problem. Not sure whether it's IIS setting or domain policy or something else.....
Not sure what's causing this issue. The only difference that I can see between DEV and UAT/PROD is:
1. DEV has no load balance but UAT and PROD has.
2. In DEV application is installed under Default Website and on PROD/UAT it's under new website.
The IIS settings has been setup as per given KB. I
I've got a webapplication and inside this webapplication I have a webservice. An external program is going to use this webservice in the future, but for now that is not the problem. this webservice is also called from inside the webapplication. this is where the problem starts.
I keep getting this error:
The remote server returned an error: (401) Unauthorized.
I tried with imporsonate= true, but it didn't work
the webservice is called like this:
I hope some one can point me into the right direction.
I have one webserver alone in the network and all the users authenticate in another server. I'm trying to implement windows authentication in a application in the webserver, but every time that the page loads a login window appears exactly that the windows client was authenticated in the order server. Is It necessary both server stay in the same domain? Is there another way? Finally, I need to get the user id in the windows client, but webserver and domain server don't communicated between itself.
I have Asp.net web application with two web.config files and one will be Forms Authentication mode and other will be Windows authentication mode.When i provide username and password in my login page (for both authentications login page will be same)based on the username(from database or local domain ).. switching has to happen between these two web.config files User Aurthentication is done using WebService.
I have more then 75 web application live on multiple surver and now I want to have single login(form authentication) for all. Anonymous user can access all the network but once login, they can manipulate info across network without login again and again.
While running an app from the server where it is deployed the website works fine, however when trying to access it from a different machine(placed in same network), using the same credentials, it shows that I am not an authenticated user.
I have an application which is installed on local pc and is using SQL db. It is a client management system where I want to add capability to register new clients and give them access to my web site which is sharing the same SQL database with local application.
At the moment clients can register on the web site and I have ASP.NET authorisation system set up with aspnetdb_user, aspnetdb_membership and etc tables. But sometimes it happens that I need to register clients on my local application on PC and ideally would like that registration to create online account for the client as well. Then I want to be able to send him user id and password by email and let him know that he has been registered in my database and online account is ready for him as well.
Basically I want to have full synchronization between asp.net membership service and local application through SQL db. As I said both online and local apps are shareing the same SQL database. what would be the best practice to implement it.
We're developping an application that uses forms authentication and URL rewriting (www.urlrewriter.net). In order to make extension-less URL rewriting possible we had to add a default application mapping for the asp.net aspnet_isapi.dll.
The problem we're experiencing now is that when the website is accessed by http://www.myapp.com/ then the aspnet_isapi.dll gets the request and forms authentication forwards it to our login site, so the user gets redirected to http://www.myapp.com/login.aspx?ReturnUrl=%2f instead of having default.aspx displayed (which is allowed to anyone).
Here's the part of web.config dealing with forms auth:
I did quite some research on this problem but didn't find any solution. Is this scenario possible at all, or does default application mapping and forms auth using <deny users="?"/> interfere by design?
P.S. the problems only manifest when running on IIS 6, the ASP.net Development Server handles it without any problems
I have created a web application which has two section user and admin. Admin files are within ~/admin folder and user files are in ~/User folder. Admin and user has two different login page within respective directory.
Now I want two apply form authentication for admin and user section. Is it possible to apply form authentication for two different section in a web application?
I have come across some ASP.NET sites that rather than displaying a page, it launches a console-based application similar to how LiveMeeting kicks-off. I am interested in building an app that uses that feature so that I could take advantage of richer features of a console-based app, but for the life of me, I can't seem to find any info on the internet as to what type of project this would be in VS. I have tried WPF Browse Application, but thats not what I am looking for since the app type I am talking about does not run in the browser at all. The image below shows what happens when reaching the web site, which would therefore then launch the console-application (which is not even installed on the client's machine)