something weird is happening! is a couple of days that my users are experincing a "logging out" isses, the error message is:
Event code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid.
Here the data:
1. the website is running on 3 server behind a load balancer
2. yes, machine key is the same all across thw websites, because the configuration is shared and all servers are pointing to the same folder on a NAS, this is the key:
<machineKey decryption="AES" decryptionKey=" ... snipped for security reasons ... " validation="SHA1" validationKey=" ... snipped for security reasons ..." />
3. I created the keys using an console app as suggested here: http://msdn.microsoft.com/en us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations
I spent a day trying to make Ent Lib Logging work and log anything into database or event log. I have a web application and console application with the same Ent Lib config but only the console application is capable to log into the Event Log. I tried everything with permissions but I don't know what exactly I am doing — which services should have what. It does not work!
I read articles like this[URL] and I want to try to give the ASPNET account those permissions. I am using Windows 7 and I cannot find ASPNET user account. So where is it?
This is the config file which is automatically generated from Ent Lib utility and it works only on App.config, not on web.config:
I think my subject line explains my problem in a nutshell.. I have a login page, I login like I should and everything works.I logout and when I type/paste the address to the page, in the address field, I still reach it just like if I was still logged in..The page I type in the address field is in a subfolder, only suppose to be able to be reached by logged in users and in this folder,ith it's own web.config-file:
I'm debugging some unexpected behavior and while tracing in to the .NET framework I see a bunch of stuff like this:
if (Logging.On) { Logging.PrintInfo(Logging.Web, this, SR.GetString(SR.net_log_n_certs_after_filtering, filteredCerts.Count)); ... }
But (as expected by default) the execution steps right over these. Is there some way to turn on the logging? Or is that just something that the framework developers can do while making special builds of the framework?
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to the windows event log. The other doesn't.Is there a setting in IIS or the web.config to enable event log logging? I'm really looking for avenues for investigation.
Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. review this log entry to discover what caused this error to occur.
However there is no error in the application event logs. So I am wondering if there's a specific setting in IIS or for the virtual site that enables logging?
Changing the customerror setting in the web.config seems to have no effect. I don't think it's even getting that far. IIS 6, Windows Server 2003
i built this application my self. i allready implement this application in 3 office and there's nothing problem. but when i implement this in another office i got some problems with my application. i dont know why, but sometimes i've got error on my server computer. when i've got this error in my server, my client still connect to my server and they can use my application( i have 5 client). this error happen 5 or 6 times a day.
I am using asp.net membership and the login control. I would like to prevent a user from logging in with the same use rname if they are already logged in. I would like to place code in the LoggingIn or Authenticate event of the login control to check whether the user is login and prevent them from logging in again. Any ideas on the best way to do this?
I have a application, and I want to log exceptions to a file and I don't want to change any code. I just want a component to which I can add my code and it will start logging exceptions. How can I do this?
I have created a login page which uses the Login control. If the user is not already registered they a redirected to another page to register. My client wants them to be logged in from when they register, and taken to the main page of the application.
How do I log a user in manually, without using the Login control? Am using forms authentication, and have the dbo.aspnet table and stored procedures already created.
Im building a web application that charges for access on a per user basis. Ive used standard roles and membership for setting up accounts and logging in. I want to ensure that a client cant use the same user details to login more than once
ie if user abc1 is already logged in, someone else cannot login again using the same credentials
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, false); After doing this, the user is logged in with the txtUser.text
But the question now is, how do i retrieve that user name from Authentication or whatever on other pages? is it possible or not?
Because i know that person stays logged in untill he logs out with this code: FormsAuthentication.SignOut();
And one more question i dont know is this one good for this or not how do i better check if the person is typed in correct name and pasword or not, with executescalar or executereader?
I'm very new to asp.net and c#, I understand the basics but don't understand how to create a login system using C# to connect and login using a Microsoft Access Database.
I Am using the basic ASP.Net controls. This worked yesterday and I don't believe I changed anything but when I came back today I could not login due to an error "Invalid postback or callback argument" which really confused me because like i said, it worked yesterday. I researched and found a solution to fix that was to set
[Code]....
I did that and now can login again however can no longer logout. The controls are all on the masterpage as posted below
the code raise an error which the translated version is something like "the lenght of the data to decrypt is not valid" here is my Decrypt function: [Code]....
I have a login form from the membership and I am trying to make it so that it would redirect depending on role. I have tried to put this code under login1_loggedin but it didn't seem to work. how can I do this?
The db connection seems to work. I can create new users with the new user wizard control. And they show up in the databaser. But i cant log in. I use the log in control and just get "wrong password". I am sure i type the correct password as i made it very easy. here are my webconfig settings.
There is one thing i have no clue how to configure. The APPLICATION NAME. What is it? And what should i set it to?
Is there something here messing up my login functionality? I can't log in. Before when I was logged in, I couldn't log out. It seems to have started when I clicked on "Remember me". Could there be something conflicting with web.config and the aspnetdb profile provider service setting that was initially set regarding profiles/roles/access?
I have a requirement to log all/most forms authentication transactions that take place within my page. For example, if someone is kicked out because of forms authentication, I'd like to get their username, time when kicked off, and where this happened. Is there a good way to do this. Better yet, has anyone done this already and is willing to share some code or post a link?
How can I prevent user to go back after logging out from any of the page of my website ? Even if the user press back button, redirected to the login.aspx page. Like we have seen in social or any other member ship sites.
I am trying to insert a string and random number into the database as hash sha1 then loggin in against it. the problem is if I use hash it wont login but if i dont use hash the login works fine... Code below.
insert hash into db Dim user As New Label user.Visible = False user.Text = (myDataReader2.Item("username")) MyConnection2.Close() Dim MyConnection3 As New Data.SqlClient.SqlConnection("Data Source=xxx") Dim mycommand3 As New Data.SqlClient.SqlCommand("Update Register SET [Password] = @password WHERE [username] = '" & user.Text & "' AND [email] = '" & email.Text & "'", MyConnection3) Dim pass As String Dim rnd As Integer, randomNum As New Random rnd = randomNum.Next(1000, 10000) pass = "Pass" & rnd mycommand3.Parameters.AddWithValue("@password", FormsAuthentication.HashPasswordForStoringInConfigFile(pass, "SHA1")) MyConnection3.Open() mycommand3.ExecuteNonQuery() login page Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires upon attempting to authenticate the use If Not (HttpContext.Current.User Is Nothing) Then If HttpContext.Current.User.Identity.IsAuthenticated Then If TypeOf HttpContext.Current.User.Identity Is FormsIdentity Then Dim fi As FormsIdentity = CType(HttpContext.Current.User.Identity, FormsIdentity) Dim fat As FormsAuthenticationTicket = fi.Ticket Dim astrRoles As String() = fat.UserData.Split("|"c) HttpContext.Current.User = New GenericPrincipal(fi, astrRoles) End If End If End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim myConnection As New SqlClient.SqlConnection Dim myCommand As New SqlClient.SqlCommand Dim intUserCount As Integer Dim strSQL As String myConnection = New SqlClient.SqlConnection("Data Source=jrome2.db.4961680.hostedresource.com; Initial Catalog=jrome2; User ID=jrome2; Password=Richard050283;") strSQL = "SELECT COUNT(*) FROM Register " _ & "WHERE UserName='" & Replace(txtusername.Text, "'", "''") & "' " _ & "AND Password='" & Replace(txtpassword.Text, "'", "''") & "';" myCommand = New SqlClient.SqlCommand(strSQL, myConnection) myConnection.Open() intUserCount = myCommand.ExecuteScalar() myConnection.Close() 'Response.Write(intUserCount) If intUserCount > 0 Then FormsAuthentication.Initialize() Dim strRole As String = AssignRoles(txtusername.Text) 'The AddMinutes determines how long the user will be logged in after leaving 'the site if he doesn't log off. Dim fat As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, _ txtusername.Text, DateTime.Now, _ DateTime.Now.AddMinutes(30), False, strRole, _ FormsAuthentication.FormsCookiePath) Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName, _ FormsAuthentication.Encrypt(fat))) Response.Redirect(FormsAuthentication.GetRedirectUrl(txtusername.Text, False)) Else login.Text = "Incorrect Log In Information" End If End Sub Private Function ValidateUser(ByVal strUsername As String, ByVal strPassword As String) _ As Boolean 'Return true if the username and password is valid, false if it isn't Return CBool(strUsername = " & Replace(txtusername.Text, " AndAlso strPassword = " & Replace(txtpassword.Text, ") End Function Private Function AssignRoles(ByVal strUsername As String) As String Dim myConnection As New SqlClient.SqlConnection Dim myCommand As New SqlClient.SqlCommand Dim intUserCount As Integer Dim strSQL As String myConnection = New SqlClient.SqlConnection("Data Source=jrome2.db.4961680.hostedresource.com; Initial Catalog=jrome2; User ID=jrome2; Password=Richard050283;") strSQL = "SELECT COUNT(*) FROM Register " _ & "WHERE UserName='" & Replace(txtusername.Text, "'", "''") & "' " _ & "AND Password='" & Replace(txtpassword.Text, "'", "''") & "';" myCommand = New SqlClient.SqlCommand(strSQL, myConnection) myConnection.Open() intUserCount = myCommand.ExecuteScalar() myConnection.Close() 'Response.Write(intUserCount) If intUserCount > 0 Then Return "client" Else Return String.Empty End If End Function Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) txtusername.Text = String.Empty txtpassword.Text = String.Empty End Sub
I have a website built in ASP.net 3.5, using WinForms and AjaxToolKit. I have encountered a lost/corrupt session issue while using Internet Explorer 8.
1. Login, Redirect to Landing, Logout - WORKS AS EXPECTED 2. Login, redirect to Landing, Close Window, Open Window, Logged-in already - WORKS AS EXPECTED (remember me enabled by default in code)
1 IE8 Browser, 2 Tabs -------------------------------------- 1. Login, Redirect to Landing, Open new tab, paste Landing page URL, Landing renders. - WORKS AS EXPECTED - Logout from Tab 2, Tab 1 logs out after AJAX update. - WORKS AS EXPECTED - Login from Tab 1, Redirects to Landing, then Redirects back to Login page - ISSUE
[code]...
2. Close Window,Login,Redirect to Landing - WORKS AS EXPECTED
2 IE8 Browser, 1 Tab -------------------------------------- 1. Open 2 IE windows 2. In Window 1, Login, Redirect to Landing, then Redirects back to Login. - ISSUE - Window 2 Paste Landing page URL, Landing page renders - ISSUE, STRANGLY NOW WORKS
[code]...
This issue seems to only happen when I have multiple tabs open,or multiple rwssers open.Firefox and Chrome does not reproduce this issue and works as expected.How do I make sure the Cookie/Session is being handle correctly in IE8?
Here is my Login Auth:
[Code]...
Web.Config
[Code]...
Server 2008r2 Seesion State: Cooke Settings: Mode: Use Cookies;
I have a problem configuring web.config file. In root directory I have a web site that doesn't require logging in to be viewed (public section of the web site) and I also have a folder ("Administration") that needs logging in to get access to it. Login.aspx is located in folder "Administration".
The question is how to properly set up the web.config to connect Administration/Login.aspx with Administration/Default.aspx. I tried editing web.config in root directory by adding the following lines, but it only shows me Login.aspx and it redirects me to the public section:
[Code]....
Do I also have to add web.config in "Administration" folder and with which parameters?