I'm having an issue with Umbraco 7.1 (developing on localhost), with which I can't login to the Umbraco UI and I receive the message "Login failed for user MyUser". Using developers tools I also get the error "Failed to load resource: the server responded with a status of 400 (Bad Request) http://mysite.local/umbraco/backoffice/UmbracoApi/Authentication/PostLogin
Is this something to do with using localhost maybe or is there another reason? A few other people have had what seems the same issue but none of those threads have a conclusion, so I was hoping there might be an update on the issue at this point?
I've tried fresh installs of versions Umbraco 7.1 & 7.1.1 with MySQL 5.6, .NET Framework 4.5.1 & IIS7. I've also tried it in Chrome and Firefox browsers as I heard Chrome can have issues with caching. Any help would be really appreciated.
Hmm, could you try doing a fresh installation using CE SQL? Just to see if this may be related to the use of MySQL?
I suppose it does not help to refresh the browser window when trying to log in? Yes it's a basic question but I've seen this in an earlier release where I just refreshed the browser window and then I could login just fine :) - Perhaps try having the console log open with the "disable cache..." enabled if you're using Google Chrome.
Thanks for the reply! I've just tried a fresh install with CE SQL and I get the same issue unfortunately! I've also cleared my browser caches and also disabled the cache whilst my DevTools are open.
Ok...maybe it's a good idea to create an issue about this on the issue tracker with a reference to this post. Seems like a bug that needs to be handled. It's just so strange that it happens to some and not to others...
If one of you create an issue please make a link to it from here as well.
Does the web.config have a Machine Key defined?
Is the web.config file the same as on your local machine (except for maybe connection string differences)?
Because you entered your credentials wrong 5 times, you can set maxInvalidPasswordAttempts to a different value for the UsersMembershipProvider in your web.config file. For example maxInvalidPasswordAttempts="15".
It's to prevent hackers from trying millions of passwords trying to guess yours.
All of a sudden I was not able to login into Umbraco Backoffice. I did set the admin user back to userNoConsole = false in the umbracoUser table. Still not able to log in.
I tried restoring a backup of my database, and then I was able to login. The PostLogin error went away. Could there be another place in the database, which could cause this issue I thought to myself?!
I suspected the 301 URL Tracker package for messing up paths to Umbraco Backoffice API methods. So I deleted all records in table icUrlTracker, and presto, I could log in to Umbraco Backoffice again.
I hope this can help others. If anyone can recreate the problem with "301 Url Tracker", it must be a bug in the package and the author should be notified about it :-)
It's used for blocking any further login attempts after a certain number of failed login attempts for that user. In 7.1.5+ and 6.2.2+ we've increased the default number of failed attempts before you get blocked from 5 to 20.
khm1985 that is an awesome post. You've just saved my evening of swearing.
I had a working copy of Umbraco 2 hours ago - was in the middle of adding some new stuff and then suddenly it stopped letting me log in. I tried everything... 400 errors everywhere,.
Trunced the table [icUrlTracker] and viola! THANKYOU!
We're having this issue, with the 400 error messages on the PostLogin call on a new desktop build that we have. It's Windows 8.1 Enterprise.
The crazy thing is that we have the Umbraco site in TFS from another dev virtual desktop environment (based on Server 2012), using exactly the same database, and the same files, where it works perfectly.
Have spent hours pulling our hair out, checking all of the above. Installing fresh Umbraco's via WebMatrix, initially with SQL CE and then full SQL. Done a full compare of all config files (applicationHost, web.config, etc). Windows firewall is off. Checked user logins in SQL DB etc.
Nothing at all in the umbraco Trace Log. Same behaviour every time.
When a new site is installed, at the end of the install process the user is logged into the backend. But if you close the browser, you are then unable to login again. Even if you open an incognito window while you have the logged in session, it's not possible to login.
Same issue here, I have a local environment and a different staging environment that shares the same database. I can log in on the staging environment but not locally as of yesterday.
I've verified that userNoConsole is false, compared the web.config files, and checked the Trace Log - everything looks correct.
Hi guys, I have the exact same problem. I have the same files and db on both server and local machine and on the server I can't loggin. I get a 400 message, bad request.
Both solutions are under IIS...
I'm getting this error as well on a few local sites, after re-installed my machine with windows 10, all my dev sites are giving me "400 bad request" on admin login.
I tried a fresh umbraco installation with SQL CE (my other dev sites are using this as well), and it works fine.
I tried setting the "NoConsole" to false on my other sites (its not false on the new one), and tried changing the hashed pw in the database to the new one..
I'm still not able to log in to the back-office.. Pulling hair, swearing and fiddling with things aren't helping either.
In the end we rebuilt a whole new desktop image and installed things one by one. We had it successfully working with VS 2012 & 2013 installed and SQL 2012.
What we did then notice was that installing the tools required to do SSIS packages then made it break. I can't recall exactly what install it was though and the guy that did it is on holiday.
Must be some sort of versioning of a specific .Net DLL or something weird!!?
If anyone does manage to trace it down it would be incredibly helpful.
I haven't set up the IIS, I'm just using the debug in visual studio.
Both solutions are just set up with visual studio + nuget umbraco.
A completely new site with umbraco installed through nuget works perfect.
Umbraco frontend and controller actions works fine, but the login returns 400 bad request.
It may be a good suggestion that the .net isn't registered correctly, since I've battled this issue before when installing different versions of Visual Studio.
I'm going to battle this a bit more, if I manage to get it working, I'll let you know what I did.
Things I've tried;
Re-installing umbraco via nuget
Enabling IIS in windows features and enabling application development etc.
running aspregiis
Installing a fresh copy of umbraco 7.3.3 into a new web application via nuget.. -> Login works perfectly... I guess I'll have to do something like that and setup the whole shabang again..
Interesting fact, though; Swapping the database on the fresh (working) installation, the login breaks and throws the 400 bad request, so I guess it has to do with the SQL CE database beeing copied... Very strange.
Hi
I have the same issue with version 7.3.7
first login after instalation is OK but after a while and session expiration i cannot login to system again.
We are facing the same issue in 7.3.7
for some reason the field "userNoConsole" is changed to "1" in the UmbracoUser Table
after that we cant login to the backoffice.
I'm having the same issue, except none of the above work and I can still log in with other users, just not my top level admin... This happens fairly often and each time it seems to fix it's self in a different way each time.
I haven't had this happen for a while, but now it's doing it again. I can run the Umbraco site locally (had updated to v7.3.4) with setting the connection string to use my Azure database and then log in to the backoffice, add new users, make content updates, etc. But, when I deploy everything to my Azure web server, I can't log in to the admin despite all files and data being the same.
It acts as if it doesn't connect to the database to check the user login, it just throws the Bad Request error almost immediately no matter what username and password you put in.
I have hit this a couple of times before and again today on a site I've not accessed for a while. I think there was a Windows update or something in the past which may have broke things but adding the following to the web.config fixed it for me:
Thanks Simon, this solved my issue with the admin user being locked out in 7.3.8 with the response: /umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request) error.
The userNoConsole was set to 1 and resetting to 0 did nothing, nor did resetting the admin password in the database or restarting IIS.
I'm having similar issues here. Any help would be greatly appreciated.
I'm running Umbraco v7.4.3 on local IIS. Installed with SQL CE database. The installation process went without a problem. However, when I tried to log back in, it wouldn't let me!?!
I'm sure the password is correct because I had to reinstalled the site again due to this exact same issue. So I paid extra attention on the password, and it's defintely not a incorrect password.
Start by setting debug=false in your web.config an then try again, see what happens. In your network tab there may be more information on the failed PostLogin request. If not, check your logs.
Also make absolutely sure that your web.config is exactly the same as the one we ship with (with just the version of Umbraco added and the connectionstring updated).
Everything else is absolutely the same. I've not installed any starter template, or made any change in the admin section. The first thing I did upon finishing the installation was to log out.
As for the 100 error in the console, I took a screenshot of the network tab as you suggested:
However, in the 'console' where 400 error is logged. When I click on the link on the right (http://mydomain.com/umbraco/backoffice/UmbracoApi/Authentication/PostLogin), it returns the following:
Make sure to check ALL of the other suggestions in this thread, including what the user looks like in the database (check the noConsole column) and make sure to set debug=true in web.config.
Thank you for your suggestions. I have checked the umbracoUser table in SQL CE database, and the 'noConsole' shows up as an unchecked checkbox, so I assume that means 0 (or false)? Also set debug=true in the following block in web.config
Unfortunately, the issue still persists. I also tried a fresh install of v7.3.8 and v7.2.8, both with SQL CE, and both had exact same issue. I'm not sure if it's an SQL CE issue as I've always worked with SQL server 2008 R2, and have never come across this problem before. The only experience I've had with SQL CE was with v6 (hosted on local IIS on Windows 7), and there was no issues there.
By the way, I'm hosting all the site in IIS on my local Windows 10 machine. The first time I encountered this issue was yesterday, when I ran the site in IIS Express straight from Visual Studio (installed v7.4.3 via NuGet).
I'm having the same issue on my dev machine. Brand new install via the downloadable zip with 7.4.3, SQL Server 2012, Windows 7, IIS 7. I'm still working through the suggestions in this thread.
I'm having the same issue on another install on the same machine after upgrading from 7.1.6 to 7.4.3. This install is running in IIS express and was installed via nuget.
I have just tried 2 other different set ups both with clean install of v7.4.3. Unfortunately both have experienced the exact same issue: 400 error on the 'PostLogin'.
set up 1: (Localhost)
Local IIS (Windows 10)
SQL 2008 Server
set up 2: (remote server on network)
IIS on Windows Server 2008 R2
SQL 2008 Server
No modifications made to both installations. Once set up had completed, I logged out straight away and tried to log back in. That's when the issue occurred.
I have multiple sites running Umbraco v6 using set up 2. And none of which has ever had this issue before. All permission are set exactly the same way. The web.config of v6's is quite different to v7's, I'm not sure what to look out for so just kept it the way it came in as.
Would anybody be kind enough to provide a working version of their web.config, obviously with sensitive information removed, so I can compare it with the stock one?
This sounds odd - there's something in the mix here that is causing issues and I'd be surprised if it's the web.config if you've tried two different installs and on a remote server.
I'd imagine it's something browser / client side.
Try - a different browser (login cookie issue?).
And / or setting your password on install to something safe (are you entering some kind of special character that's being stripped on login??).
Is there a different PC that you can try logging into the remote server via..
Thank you Steve for your input. I agree, this is indeed very strange.
Okay, here are some information regarding the installation:
password = "password" no surprises there.
url = mydomain.local/umbraco/... now, I suspect it might have something to do with this? since it's not a real domain? I'm using my hosts file to point to the local (and remote) server, rather than going through a DNS. However, I've always done this in the past with v6 and never had problems.
I have tried in 3 different browsers and cleared cache each time, still getting the same result.
I will try a different PC later and let you guys know what happens. I will have to modify the hosts file since I don't have a DNS server.
Not sure if you saw my last couple of messages. Have you tried logging in with your email instead of name? Umbraco seems to set email address (the one you entered during set up process) as username by default. That's why I couldn't log in before.
It seems that you may have other issues with the set up than I did. Did you get a chance to take a peek at the log file? Wondering if you've been getting the same errors as I did before.
By the way, I made no modification in web.config, and I'm running v7.4.3 locally (IIS Express) right from within Visual Studio.
Ok, just accessed the 'UmbracoTraceLog' in '/App_Data/Logs'. And there seems to be some kind of error:
2016-07-06 10:08:40,449 [P4556/D2/T9] INFO Umbraco.Core.Sync.ApplicationUrlHelper - ApplicationUrl: http://mydomain.local:80/umbraco (UmbracoModule request)
2016-07-06 10:08:41,009 [P4556/D2/T9] WARN Umbraco.Web.UmbracoModule - Umbraco has no content
2016-07-06 10:08:43,064 [P4556/D2/T9] WARN Umbraco.Web.UmbracoModule - Umbraco has no content
2016-07-06 10:08:49,572 [P4556/D2/T9] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IParameterEditor
2016-07-06 10:08:49,587 [P4556/D2/T9] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IParameterEditor, found 0 (took 19ms)
2016-07-06 10:09:10,589 [P4556/D2/T17] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.Persistence.Mappers.BaseMapper
2016-07-06 10:09:10,605 [P4556/D2/T17] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.Persistence.Mappers.BaseMapper, found 0 (took 14ms)
2016-07-06 10:09:11,009 [P4556/D2/T17] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: Login attempt failed for username npadmin from IP address 192.168.0.144
2016-07-06 10:09:19,042 [P4556/D2/T17] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: Login attempt failed for username npadmin from IP address 192.168.0.144
2016-07-06 10:09:48,943 [P4556/D2/T10] INFO umbraco.BusinessLogic.Log - Log scrubbed. Removed all items older than 2016-07-05 10:09:48
2016-07-06 10:09:51,870 [P4556/D2/T14] ERROR Umbraco.Web.Scheduling.KeepAlive - Failed (at "http://mydomain.local:80/umbraco").
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'mydomain.local'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Umbraco.Web.Scheduling.KeepAlive.
I'm not sure what to make of this. Would anyone be able to help please?
Thank you for helping out mate! I have discovered what the issue was as per my previous post. It was a silly, silly mistake on my part - I forgot Umbraco uses email address as username by default. And I kept using 'name', of couse it wouldn't let me in.
I've done another fresh install from the downloaded zip, immediately logged out, and then am completely prevented from logging in. I can navigate to the site, but since there's no content there my only option is to attempt to login, which fails.
Interestingly, I've tried to log in repeatedly with the intention of trying to lock the user. That never occurs. The user never gets locked (the userNoConsole value is always 0, failedLoginAttempts is null, as is lastLockoutDate). There are no errors in the logs; just the "Login attempt failed for username XXX from IP address 127.0.0.1." The fact that none of those fields are modified makes me think there's a disconnect somewhere after the initial install and configuration.
Does anyone have any suggestions on what to try next?
Yes, I see the same immediate "400 Bad Request" that many, many other people in this thread have mentioned. There exists an issue in the issue tracker for this problem. It was closed as "Can't Reproduce" and then ignored by the Umbraco dev team. That seems to be a bit of a recurring theme around here. Often the user is directed back to these forums, where it becomes clear that there is a problem, only to be told they need to open an issue in the Issue Tracker. It's a frustrating cycle.
It is SUPER frustrating, indeed, especially since.. unsurprisingly, we haven't been able to reproduce this problem. If you have this problem and have steps to reproduce it and it is also broken on other people's machines then we can do something about it.
What's also frustrating for us is when people who have this problem add to this post saying "I have this problem". There's many suggestions and various fixes in this post and in the issue on the tracker. It would be much more valuable if you have this problem is to list the things that you've actually tried (not just: I've tried everything, there's so many suggestions that it's hard to believe that you tried literally every one of them).
So: no, we are definitely not ignoring the issue, we just cannot find a cause for it other than user error sometimes (for example: rewrite rules, forgotten passwords, misremembered user names etc.).
I will list the exact steps I go through to perform an upgrade which will not allow me to log in.
For my existing 7.1.6 install upgrade (Windows 7, Umbraco 7.1.6 to 7.4.3, SQL Server 12.0.4213.0, Visual Studio 2013, IIS Express):
I comment out all rewrite rules before beginning an upgrade.
I test my username and password (which are stored in a password manager; no possiblity of fatfingering it when copy and pasting) by logging into the existing site on my development machine.
Stop the website
I perform an upgrade via nuget
I add back in our Global.asax.cs file and modify the Global.asax file to load it.
I fix the UsersMembershipProvider type in our web.config. It does not get correctly modified to "Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" by nuget
I remove the following foreign keys from my database because they
cause the upgrade to fail as detailed in this fixed issue.
using both my old userLogin as the username (which still works in production) and the userEmail as usernames (neither works)
checking the umbracoUser table for problems (userNoConsole, failedLoginAttempts)
Check that my web.config has a machineKey value defined (it does)
Logging in via another browser, or in incognito mode to rule out bad cookies. (no luck)
Checking the logs:
2016-07-11 15:38:02,117 [23] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: Login attempt failed for username USERNAME from IP address 127.0.0.1
Checking that .NET 4.5 is installed (it is. This project is a .NET 4.5 project)
Check to see if I have 301 URL Tracker installed (I do not)
Uncommented the rewrite rules (no luck). Commented them out again (no luck).
Added the CustomHeaders values suggested here. (no luck) Removed them (no luck).
Set "debug = false" in my web.config. (no luck)
Set "debug = true" in my web.config (no luck)
Added "config.MapHttpAttributeRoutes(); " to my WebApiConfig per this Stack Overflow post (no luck)
Check that Webdav is already disabled (it is), Enable ExtensionlessUrlHandler (no luck)
Having done all of that, I still see only "Login failed for user" in the browser and this in the console:
I do see the "failed login attempts" increment as I am testing (with the valid password I began with copy/pasted into the form). I have to reset the userNoConsole flag as I am locked out. After the account is locked, and then unlocked (userNoConsole set = false) I have to restart the site before the "failed login attempts" begins to increment again.
I do have SQL Server Data Tools (I think that's what is referenced here) installed.
I had the same login issue with a fresh 7.4.3 install (same sql server, same OS, directly into IIS rather than through IIS express).
Is there any way that I can step into the umbraco code provided via nuget to debug (a source/symbol package)? I attempted to download the source code and step into it, but the nuget package assembly hashes do not match that of assemblies I build locally. I could point my local environment at those locally built assemblies, but that seems like an invalid test.
What other information can I provide to you to help in reproducing/debugging/fixing this error?
I add back in our Global.asax.cs file and modify the Global.asax file to load it.
What are you doing in Global.asax.cs? We prefer you use ApplicationEventHandlers to do stuff on startup
I fix the UsersMembershipProvider type in our web.config. It does not get correctly modified to "Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" by nuget
What is it currently, before you correct it? I can look into it.
I remove the following foreign keys
The issue you link to indicates it's fixed though, so if you upgrade straight to 7.4.3 this should not be necessary.
I cannot log back in.
Can you check these two properties on the UsersMembershipProvider are set to useLegacyEncoding="true" and passwordFormat="Hashed"? I'm assuming that's how they were set on your old version.
Check that my web.config has a machineKey value defined (it does)
It doesn't need to, is there a reason for that, that you know of?
Is there any way that I can step into the umbraco code provided via nuget to debug
Not sure, you can however build the 7.4.3 source and use the output files in src\Umbraco.Web.UI\bin to drop into your bin folder. You can then attach the debugger to your running site with those binaries and debug the Umbraco source.
It remains unchanged after the upgrade. I believe that this is the same problem mentioned in this post.
I do not have a value for useLegacyEncoding.
I'm aware that the ticket is marked fixed, but I'm still seeing that issue when performing the upgrade to the newest version (7.4.3) in nuget:
The MachineKey value (I have a validationKey and decryptionKey) is, according to the MSDN Documentation, used to validate forms authentication, and to encrypt and decrypt data.
Additionally, it seems that if I do not run the site and login before I perform the upgrade via nuget (thus caching login credentials in my browser) I'm prompted to login to authorize the upgrade, which fails with this issue. Remember, I've removed the redirect rules from my web.config, so I do not know how that could be the issue.
However, manually adding the useLegacyEncoding="true" to the UsersMembershipProvider allows me to login after the upgrade.
The fact that the UsersMembershipProvider's type isn't being modified makes me suspect that the issue is that the whole tag isn't always correctly being updated/modified by the upgrade process.
It looks like there are a number of issues with the upgrade not correctly applying certain changes, both to the database (keys not being removed, columns being added too early in the process) and the codebase (the UsersMembershipProvider key in the web.config). Hopefully these details will help anyone else running into these issues, and provide a starting point for the dev team to look into fixing the upgrade package, both in nuget and via the downloadable zip files.
Alright, I had a look at this, are you sure that adding useLegacyEncoding="true" fixed the problem? This is the default value if the setting is missing. We don't add or change this setting during upgrades on purpose, we don't want to break people's installs if they've set it to "false".
Would it be possible for you to get me a backup of your database? Could you email a WeTransfer or Dropbox link at [email protected]? Then I can look into why your database upgrade doesn't work as expected.
Also, if you can zip up the website and email it me too, I can look at why you explicitly need to add useLegacyEncoding="true".
I think I've just had something similar - it was a situation where I wasn't sure of the password.. but what had happened was I'd left open a login screen and stopped the website. It had been down for some time (so any keep alive pings etc would have failed).
When the site came back up I tried logging in on the tab I'd left open in the browser. It didn't work - until I refreshed the page. It seemed to work - it was replying with incorrect user name / password.
Had me confused for a good ten minutes. Could this possibly be what everyone is doing? Can this be fixed by having some JS on the login screen hide the login and request the page to be refreshed if the server can't be reached?
I upgraded from Umbraco 7.4.3 to 7.5.2 using Nuget. I then used Visual Studio's Web Deploy to build and deploy to a localhost install using SQL Server CE 4.0 and to my hosted test environment using Microsoft SQL 2014. In both cases I received "Login failed for user [admin]" when the redirect upgrade was trying to start.
The solution in my case was to download the Umbraco 7.5.2 zip file and copy the bin, Umbraco and Umbraco_client folder contents to my build environment. After building and deploying, everything is working as it should.
The only conclusion I can draw is that the Nuget upgrade broke something.
I encountered the same issue and tried a number of the above but none were working. The website was also in production (was working fine in staging and development) so re-installing was not an option.
To debug I was using ARC (or Postman) and posting directly to the login URL, ex:
Okay regarding the above its some weird caching issue where basically after certain amount of time is reverting back to the admin user set by the above mentioned .dll file
I am currently developing an Umbraco 7.5.7 site, so I always start the site from within Visual Studio. Database is MS SQL Server 2014. It was working fine yesterday, i.e. I could login to backoffice with my only admin user .
Read the whole topic, and REALLY tried everything. I am using the "start" button in Visual Studio to start the site. My admin user cannot login but my other user who is not admin can. I get the "400 bad request" response like all the other people here did.
Both the admin and non-admin users have the same password so their password hash is also the same.
"userNoConsole" never becomes "1" in my case.
I tried the "umbraco admin reset" by putting the DLL into the bin folder, stopping/restarting project (making sure IIS Express is also closed and reopened). It is supposed to set the userLogin to Admin and password to Admin1234! . It can change the userLogin to "Admin" but password does not change at all! It remains what it was and I still can't login.
By the way when I login with my non-admin user, I can change that user's password without any problem. Only thing that is problematic is the user with id=0.
I even tried to debug the "umbraco admin reset" project but there are no errors, no exceptions are thrown, no errors in UmbracoTraceLog file...
I have no other option left than dropping and recreating the database from an older backup.
Edit: I worked the problem around following these steps:
1) As I said, I had a non-admin user which could login. I set its userType to 1. I noted down its "id" (in my case it was 1).
2) I opened "umbracoUser2app" table for editing. This table holds information about places each user can access. There were seven lines for user 0 because that user is admin, and two lines for user 1 (namely content and media). I added other app names for 1 as well, so in the end user 1 had the following apps: content, developer, forms, media, member, settings, user.
3) Now I can login with my other user and access everywhere in the backoffice.
So if you at least have another user other than the admin, you can follow this approach I suppose. I didn't try creating user manually directly on DB, perhaps it works too. I hope this at least solves some of the problems that we experience until developers can actually reproduce it and find out the real cause.
Hello guys. I went through this today. After a period the login has expired. I do not know how in the database the column userNoConsole changed to 1. The solution was to change userNoConsole to 0, reset IIS and recompile. I also had to change the password in the database with the script below:
UPDATE umbracoUser set userdisabled=0, userLogin='admin', userPassword='bnWxWyFdCueCcKrqniYK9iAS+7E=' where id=0
My turn today. I think I just forgot the password. Anyway, want to add that if you change the password in the database remember new passwords should be 10 characters long (not sure when this change happened). I couldn't get my new password (default) to take so changed it to "defaultpassword" and it worked:
UPDATE umbracoUser set userdisabled='False', userLogin='admin', userPassword='J9aImlUpv8bmV16JmbZ+Qg==LO2uUwWbriBtClCsaecRYeVPjh7aHMp02unvQQ9ATkQ='where id=0;
OK, so I'm new to Umbraco and I had this problem too. Here's where I think the main problem might be.
When you setup Umbraco in creates a user account with userName = [whatever you put in the username field] and userLogin = [email address]. If you create another user account the userLogin = [whatever you put in the username field], which is not the same as how the initial setup admin user. This means that the initial/admin user will have to use his email address to log in and other users that are added afterwards CANNOT use their email address to login.
And then to top it off, the user account system does NOT use "OR" to lookup the user. Ideally (in my opinion) there should be unique index on userName, userLogin, and userEmail and then you should be able to use any one of those three to login to your account. Assuming that's not of interest to the primary developers, I think the UI should at least be a little more helpful in helping you know how the data your entering is going to be stored and used during the login process and I think that the behavior should be consistent. If userLogin = emailAddress during initial creation, then make it be the same way when you enter new additional users.
Now I'm not talking about "membership" here, only backoffice users. I haven't even tested the membership system yet.
This is a long thread so I haven't read every single comment so excuess me if what I'm about to say is not relevant.
The otherday I was installing Umbraco and after entering all the information in to the wizard screen I kept getting Login Failed for umbraco user....
It was very strange, but it turns out becuase the password to the db connection string had a & in it the umbraco installation failed to read the password in correctly, as soon as the password was changed to one with out a & in it, the error went away.
Is this a bug in Umbraco? anyone else had anything similar?
Copy the following folders from inside the .zip file over the existing folders in your site:
/bin
/Umbraco
/Umbraco_Client
Any file in the /Config folder
The /Global.asax file
The web.config file in the root of your site (Important: make sure to copy back the version number, and the connection string as they were.)
In rare cases, the Web.config file in the Views folder
Okay so I have gone through the extremes of creating a local version of 7.2.1 both database and files then updated to 7.13.2 using nuget and falling at the same hurdle this is so frustrating surely it shouldnt be this painful.
Login failed for user in Umbraco 7
Hi All,
I'm having an issue with Umbraco 7.1 (developing on localhost), with which I can't login to the Umbraco UI and I receive the message "Login failed for user MyUser". Using developers tools I also get the error "Failed to load resource: the server responded with a status of 400 (Bad Request) http://mysite.local/umbraco/backoffice/UmbracoApi/Authentication/PostLogin
Is this something to do with using localhost maybe or is there another reason? A few other people have had what seems the same issue but none of those threads have a conclusion, so I was hoping there might be an update on the issue at this point?
I've tried fresh installs of versions Umbraco 7.1 & 7.1.1 with MySQL 5.6, .NET Framework 4.5.1 & IIS7. I've also tried it in Chrome and Firefox browsers as I heard Chrome can have issues with caching. Any help would be really appreciated.
Kind Regards
Hi pronto
Hmm, could you try doing a fresh installation using CE SQL? Just to see if this may be related to the use of MySQL?
I suppose it does not help to refresh the browser window when trying to log in? Yes it's a basic question but I've seen this in an earlier release where I just refreshed the browser window and then I could login just fine :) - Perhaps try having the console log open with the "disable cache..." enabled if you're using Google Chrome.
Hope this helps.
/Jan
Hi Jan,
Thanks for the reply! I've just tried a fresh install with CE SQL and I get the same issue unfortunately! I've also cleared my browser caches and also disabled the cache whilst my DevTools are open.
This might be coincidental but I now get the DevTools error "GET http://mysite.local/umbraco/backoffice/UmbracoApi/Authentication/IsAuthenticated 400 (Bad Request) angular.min.js:106" before the login attempt. Any ideas what the issue could be?
Kind Regards
Hi Pronto
Ok...that's really odd...what operating system are you using?
And have you checked with the documentation on this forum to see if permissions have been setup correctly?
/Jan
Im also getting this issue but only when using windows 2008 r2
It works fine when im running it locally on my laptop.
I have followed the documentation about permissions but it still didnt resolve it
Hi Matthew and welcome to our :)
What database are you using?
And are you able to see some errors in the /app_data/logs file? (On your server)
/Jan
Im using SQL Server 2008 R2
There are no errors in the logs... just info
getting these in the browser console
GET http://sfm.local/umbraco/backoffice/UmbracoApi/Authentication/IsAuthenticated 400 (Bad Request) angular.min.js:106
POST http://sfm.local/umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request) angular.min.js:106
Ok...maybe it's a good idea to create an issue about this on the issue tracker with a reference to this post. Seems like a bug that needs to be handled. It's just so strange that it happens to some and not to others...
If one of you create an issue please make a link to it from here as well.
Cheers, Jan
as requested... raise issue and here is the link
http://issues.umbraco.org/issue/U4-4796
Does your server have .net 4.5 installed?
This is not a bug else a few thousand other people would have the same issue. So it must be a misconfiguration somewhere.
Yes the server has .NET 4.5 installed
I have given network service full rights to everything from the website down
Does the web.config have a Machine Key defined?
Is the web.config file the same as on your local machine (except for maybe connection string differences)?
We have the same issue, fresh installation of 7.1.4, I was logged in and now it won't log in.
@Scott are you using the e-mail address you used during install? The email address is your username.
If you're using that then you may be locked out, check the UmbracoUser table to see if userNoConsole is set to 1 or true, it should be 0 or false.
I had this same problem and this was the solution. Not very obvious, do you think the reply from the server should be more descriptive in this case?
( UmbracoUser table to see if userNoConsole is set to 1 or true )
Security wise - no. You should never show why someone can't log in. It allows the confirmation of a valid username.
Hi Sebastiaan,
I used my e-mail address, and yes is shows locked out in the log:
Cannot validate member [email protected] because they are currently locked out
Why does this happen, pretty frustrating?
The solution you gave worked, thank you.
Because you entered your credentials wrong 5 times, you can set
maxInvalidPasswordAttempts
to a different value for theUsersMembershipProvider
in your web.config file. For examplemaxInvalidPasswordAttempts="15"
.It's to prevent hackers from trying millions of passwords trying to guess yours.
@Sebastiaan I had an issue logging in as well, I went to umbracoUser table and changed userNoConsole to False and its working now. Thank you
Today I stumbled upon the exact same problem in version 7.1.4. When trying to logging into Umbraco Backoffice I got the error:
POST http://tena.pointshop.local/umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request)
All of a sudden I was not able to login into Umbraco Backoffice. I did set the admin user back to userNoConsole = false in the umbracoUser table. Still not able to log in.
I tried restoring a backup of my database, and then I was able to login. The PostLogin error went away. Could there be another place in the database, which could cause this issue I thought to myself?!
I suspected the 301 URL Tracker package for messing up paths to Umbraco Backoffice API methods. So I deleted all records in table icUrlTracker, and presto, I could log in to Umbraco Backoffice again.
I hope this can help others. If anyone can recreate the problem with "301 Url Tracker", it must be a bug in the package and the author should be notified about it :-)
@khm1985 thank you very much for this post, only your suggestion has helped me fixing my problem.
I had problems logging in and it was setting the 'userNoConsole' value to '0' that solved them.
What is this column used for?
It's used for blocking any further login attempts after a certain number of failed login attempts for that user. In 7.1.5+ and 6.2.2+ we've increased the default number of failed attempts before you get blocked from 5 to 20.
Thx Lewis, I think that did the trick!
khm1985 that is an awesome post. You've just saved my evening of swearing.
I had a working copy of Umbraco 2 hours ago - was in the middle of adding some new stuff and then suddenly it stopped letting me log in. I tried everything... 400 errors everywhere,.
Trunced the table [icUrlTracker] and viola! THANKYOU!
Could anyone help me with the code in web.config?
I have a 7.2.4 install and can't log on. However, I can't find the icUrlTracker table in database. What am I missing here?
icUrlTracker is not part of the normal umbraco install, it's a package (https://our.umbraco.org/projects/developer-tools/301-url-tracker).
What is the error you see in the logs? (
~/App_Data/Logs/UmbracoTraceLog.txt
)Oh, great. How do I add the maxInvalidPasswordAttempts="15" to my web.config?
Do I simply add it to this line?
You add it to this one:
The default is already set to 20 so it's not necessary to add that in 7.2.4 unless you want to change it to 15.
If you're already locked out, check the posts above and update the
userNoConsole
column in theumbracoUser
table to 0 or false.Okay, this do no work. Any way to recover the password or see what is wrong? I still can't log on.
No, the password is encrypted. The best way to get access again:
Okay, so if I copy the encrypted password from the user table of the new install to the old it should work?
Yes.
Hi guys,
We're having this issue, with the 400 error messages on the PostLogin call on a new desktop build that we have. It's Windows 8.1 Enterprise.
The crazy thing is that we have the Umbraco site in TFS from another dev virtual desktop environment (based on Server 2012), using exactly the same database, and the same files, where it works perfectly.
Have spent hours pulling our hair out, checking all of the above. Installing fresh Umbraco's via WebMatrix, initially with SQL CE and then full SQL. Done a full compare of all config files (applicationHost, web.config, etc). Windows firewall is off. Checked user logins in SQL DB etc.
Nothing at all in the umbraco Trace Log. Same behaviour every time.
When a new site is installed, at the end of the install process the user is logged into the backend. But if you close the browser, you are then unable to login again. Even if you open an incognito window while you have the logged in session, it's not possible to login.
Any ideas!?
Same issue here, I have a local environment and a different staging environment that shares the same database. I can log in on the staging environment but not locally as of yesterday.
I've verified that userNoConsole is false, compared the web.config files, and checked the Trace Log - everything looks correct.
Hi guys, I have the exact same problem. I have the same files and db on both server and local machine and on the server I can't loggin. I get a 400 message, bad request. Both solutions are under IIS...
I get this same error too... I wonder if it is a bug that was introduced.
I'm getting this error as well on a few local sites, after re-installed my machine with windows 10, all my dev sites are giving me "400 bad request" on admin login.
I tried a fresh umbraco installation with SQL CE (my other dev sites are using this as well), and it works fine.
I tried setting the "NoConsole" to false on my other sites (its not false on the new one), and tried changing the hashed pw in the database to the new one..
I'm still not able to log in to the back-office.. Pulling hair, swearing and fiddling with things aren't helping either.
I wonder what does it?
Probably didn't register .net correctly in IIS.
In the end we rebuilt a whole new desktop image and installed things one by one. We had it successfully working with VS 2012 & 2013 installed and SQL 2012.
What we did then notice was that installing the tools required to do SSIS packages then made it break. I can't recall exactly what install it was though and the guy that did it is on holiday.
Must be some sort of versioning of a specific .Net DLL or something weird!!?
If anyone does manage to trace it down it would be incredibly helpful.
Hmm.. Yeah, this is wierd indeed.
I haven't set up the IIS, I'm just using the debug in visual studio.
Both solutions are just set up with visual studio + nuget umbraco.
A completely new site with umbraco installed through nuget works perfect.
Umbraco frontend and controller actions works fine, but the login returns 400 bad request.
It may be a good suggestion that the .net isn't registered correctly, since I've battled this issue before when installing different versions of Visual Studio.
I'm going to battle this a bit more, if I manage to get it working, I'll let you know what I did.
Slowly going nuts.
Things I've tried; Re-installing umbraco via nuget Enabling IIS in windows features and enabling application development etc.
running aspregiis
Installing a fresh copy of umbraco 7.3.3 into a new web application via nuget.. -> Login works perfectly... I guess I'll have to do something like that and setup the whole shabang again..
Interesting fact, though; Swapping the database on the fresh (working) installation, the login breaks and throws the 400 bad request, so I guess it has to do with the SQL CE database beeing copied... Very strange.
I was also going nuts getting the
400 Bad Request
error on the login-screen.BUT... it turned out that in my case the error was due to an incorrect password (OMG!). I was confused by the weird
400 Bad Request
error.Hopefully, this can help someone out. :)
Version info:
Hi I have the same issue with version 7.3.7 first login after instalation is OK but after a while and session expiration i cannot login to system again.
response: /umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request)
server log: 2016-02-08 11:01:45,659 [P34804/D91/T6484] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: Login attempt failed for username [admin]from IP address [my ip]
We are facing the same issue in 7.3.7 for some reason the field "userNoConsole" is changed to "1" in the UmbracoUser Table after that we cant login to the backoffice.
I'm having the same issue, except none of the above work and I can still log in with other users, just not my top level admin... This happens fairly often and each time it seems to fix it's self in a different way each time.
Strange.. M
I haven't had this happen for a while, but now it's doing it again. I can run the Umbraco site locally (had updated to v7.3.4) with setting the connection string to use my Azure database and then log in to the backoffice, add new users, make content updates, etc. But, when I deploy everything to my Azure web server, I can't log in to the admin despite all files and data being the same.
It acts as if it doesn't connect to the database to check the user login, it just throws the Bad Request error almost immediately no matter what username and password you put in.
Still no master solution for this?
I encountered a similar problem, and it turned out to be a lowercase rule in the IIS URL rewrite module. Umbraco, for some reason, have some casesensitivity. I found a workaround at http://www.wiliam.com.au/wiliam-blog/iis-url-redirects-to-lowercase-and-umbraco-cms
I have hit this a couple of times before and again today on a site I've not accessed for a while. I think there was a Windows update or something in the past which may have broke things but adding the following to the web.config fixed it for me:
I've done this temporarily until I can investigate why.
Simon
Thanks Simon, this solved my issue with the admin user being locked out in 7.3.8 with the response: /umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request) error.
The userNoConsole was set to 1 and resetting to 0 did nothing, nor did resetting the admin password in the database or restarting IIS.
Thanks Simon!
It's not enough to edit the password hash in DB or to set the userNoConsole = 0. The DB changes became effective only after I recycled the app pool.
I'm having similar issues here. Any help would be greatly appreciated.
I'm running Umbraco v7.4.3 on local IIS. Installed with SQL CE database. The installation process went without a problem. However, when I tried to log back in, it wouldn't let me!?!
I'm sure the password is correct because I had to reinstalled the site again due to this exact same issue. So I paid extra attention on the password, and it's defintely not a incorrect password.
I keep getting this 400 error for some reason.
Have you tried the solution I posted above?
Hi Simon,
Wow! Thanks for getting back so quickly. Yes, I've added customHeaders code you suggested above. Unfortunately, I'm still getting the same error :(
My machine is running Windows 10 by the way, not sure if that makes any differences.
Chen
Start by setting debug=false in your web.config an then try again, see what happens. In your network tab there may be more information on the failed
PostLogin
request. If not, check your logs.Also make absolutely sure that your web.config is exactly the same as the one we ship with (with just the version of Umbraco added and the connectionstring updated).
Hi Sebastiaan,
Thank you for your reply.
I have double checked the web.config with the one that came with Umbraco zip, only different sections are:
and
Also, I have added the code Simon had suggested earlier:
Everything else is absolutely the same. I've not installed any starter template, or made any change in the admin section. The first thing I did upon finishing the installation was to log out.
As for the 100 error in the console, I took a screenshot of the network tab as you suggested:
Chen
Can you also post the contents of the response tab from the console and the last part of your log file where the error occurs?
Hi Simon,
The 'response' tab under 'Network' is empty.
However, in the 'console' where 400 error is logged. When I click on the link on the right (http://mydomain.com/umbraco/backoffice/UmbracoApi/Authentication/PostLogin), it returns the following:
=========================================================
)]}', {"Message":"The requested resource does not support http method 'GET'."}
=========================================================
Make sure to check ALL of the other suggestions in this thread, including what the user looks like in the database (check the
noConsole
column) and make sure to set debug=true in web.config.Try the suggestions in this answer here: http://stackoverflow.com/a/24626443/5018
It looks like the tag mentioned in that SO answer:
is already in the default web.config? Or am I missing something there?
Good morning Sebastiaan,
Thank you for your suggestions. I have checked the umbracoUser table in SQL CE database, and the 'noConsole' shows up as an unchecked checkbox, so I assume that means 0 (or false)? Also set debug=true in the following block in web.config
I added the code block from StackOverflow in the link you suggested.
Unfortunately, the issue still persists. I also tried a fresh install of v7.3.8 and v7.2.8, both with SQL CE, and both had exact same issue. I'm not sure if it's an SQL CE issue as I've always worked with SQL server 2008 R2, and have never come across this problem before. The only experience I've had with SQL CE was with v6 (hosted on local IIS on Windows 7), and there was no issues there.
By the way, I'm hosting all the site in IIS on my local Windows 10 machine. The first time I encountered this issue was yesterday, when I ran the site in IIS Express straight from Visual Studio (installed v7.4.3 via NuGet).
Chen
I'm having the same issue on my dev machine. Brand new install via the downloadable zip with 7.4.3, SQL Server 2012, Windows 7, IIS 7. I'm still working through the suggestions in this thread.
I'm having the same issue on another install on the same machine after upgrading from 7.1.6 to 7.4.3. This install is running in IIS express and was installed via nuget.
Dear all,
Just a quick update on this issue.
I have just tried 2 other different set ups both with clean install of v7.4.3. Unfortunately both have experienced the exact same issue: 400 error on the 'PostLogin'.
set up 1: (Localhost) Local IIS (Windows 10) SQL 2008 Server
set up 2: (remote server on network) IIS on Windows Server 2008 R2 SQL 2008 Server
No modifications made to both installations. Once set up had completed, I logged out straight away and tried to log back in. That's when the issue occurred.
I have multiple sites running Umbraco v6 using set up 2. And none of which has ever had this issue before. All permission are set exactly the same way. The web.config of v6's is quite different to v7's, I'm not sure what to look out for so just kept it the way it came in as.
Would anybody be kind enough to provide a working version of their web.config, obviously with sensitive information removed, so I can compare it with the stock one?
Thank you in advance.
Chen
This sounds odd - there's something in the mix here that is causing issues and I'd be surprised if it's the web.config if you've tried two different installs and on a remote server.
I'd imagine it's something browser / client side.
Try - a different browser (login cookie issue?). And / or setting your password on install to something safe (are you entering some kind of special character that's being stripped on login??).
Is there a different PC that you can try logging into the remote server via..
Divide and conquer!
Steve
Thank you Steve for your input. I agree, this is indeed very strange.
Okay, here are some information regarding the installation:
password = "password" no surprises there.
url = mydomain.local/umbraco/... now, I suspect it might have something to do with this? since it's not a real domain? I'm using my hosts file to point to the local (and remote) server, rather than going through a DNS. However, I've always done this in the past with v6 and never had problems.
I have tried in 3 different browsers and cleared cache each time, still getting the same result.
I will try a different PC later and let you guys know what happens. I will have to modify the hosts file since I don't have a DNS server.
Regards,
Chen
I've tried in Chrome, FF, and IE 11, and incognito mode in Chrome. Same result in all attempts.
@Ryan,
Not sure if you saw my last couple of messages. Have you tried logging in with your email instead of name? Umbraco seems to set email address (the one you entered during set up process) as username by default. That's why I couldn't log in before.
Chen
Yes, I've tried both the userName/userLogin and the userEmail values as specified in the umbracoUser table. I've had no luck with any of them.
@Ryan,
It seems that you may have other issues with the set up than I did. Did you get a chance to take a peek at the log file? Wondering if you've been getting the same errors as I did before.
By the way, I made no modification in web.config, and I'm running v7.4.3 locally (IIS Express) right from within Visual Studio.
Chen
Ok, just accessed the 'UmbracoTraceLog' in '/App_Data/Logs'. And there seems to be some kind of error:
I'm not sure what to make of this. Would anyone be able to help please?
Thank you kindly.
Chen
@Sebastiaan @Simon @Steve, you guys are gonna laugh at me.
Okay guys! I know what is wrong. Or at least for my case.
Umbraco uses email address as username by default, and I was using 'name'.
Sorry to bother everybody with such a noob mistake.
Chen
Hi Chen,
Q1: Are you able to access the http://mydomain.local (the public site, not the backoffice) in your browser? Can it serve a simple static html page?
Q2: Did you try http://mydomain.local/umbraco and also http://mydomain.local/umbraco/ (note the trailing fwd slash)
Q3: Are there two or more hostnames for your website in IIS? This could be an issue as well.
Hi Mihai,
Thank you for helping out mate! I have discovered what the issue was as per my previous post. It was a silly, silly mistake on my part - I forgot Umbraco uses email address as username by default. And I kept using 'name', of couse it wouldn't let me in.
Anyway, thanks for trying to help. Appreciate it!
Chen
I've done another fresh install from the downloaded zip, immediately logged out, and then am completely prevented from logging in. I can navigate to the site, but since there's no content there my only option is to attempt to login, which fails.
Interestingly, I've tried to log in repeatedly with the intention of trying to lock the user. That never occurs. The user never gets locked (the userNoConsole value is always 0, failedLoginAttempts is null, as is lastLockoutDate). There are no errors in the logs; just the "Login attempt failed for username XXX from IP address 127.0.0.1." The fact that none of those fields are modified makes me think there's a disconnect somewhere after the initial install and configuration.
Does anyone have any suggestions on what to try next?
Have you checked your browser console for errors? I suspect that you have an error as above about the resource not allowing the http method.
If this is repeatable it should be logged on the issue tracker if it's not already.
Yes, I see the same immediate "400 Bad Request" that many, many other people in this thread have mentioned. There exists an issue in the issue tracker for this problem. It was closed as "Can't Reproduce" and then ignored by the Umbraco dev team. That seems to be a bit of a recurring theme around here. Often the user is directed back to these forums, where it becomes clear that there is a problem, only to be told they need to open an issue in the Issue Tracker. It's a frustrating cycle.
It is SUPER frustrating, indeed, especially since.. unsurprisingly, we haven't been able to reproduce this problem. If you have this problem and have steps to reproduce it and it is also broken on other people's machines then we can do something about it.
What's also frustrating for us is when people who have this problem add to this post saying "I have this problem". There's many suggestions and various fixes in this post and in the issue on the tracker. It would be much more valuable if you have this problem is to list the things that you've actually tried (not just: I've tried everything, there's so many suggestions that it's hard to believe that you tried literally every one of them).
So: no, we are definitely not ignoring the issue, we just cannot find a cause for it other than user error sometimes (for example: rewrite rules, forgotten passwords, misremembered user names etc.).
I will list the exact steps I go through to perform an upgrade which will not allow me to log in.
For my existing 7.1.6 install upgrade (Windows 7, Umbraco 7.1.6 to 7.4.3, SQL Server 12.0.4213.0, Visual Studio 2013, IIS Express):
At this point I have tried:
Checking the logs:
2016-07-11 15:38:02,117 [23] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: Login attempt failed for username USERNAME from IP address 127.0.0.1
Checking that .NET 4.5 is installed (it is. This project is a .NET 4.5 project)
Having done all of that, I still see only "Login failed for user" in the browser and this in the console:![enter image description here](/media/upload/1134e8b3-837e-4849-ae44-59d05f972f9b/Umbraco%20Error.PNG)
I do see the "failed login attempts" increment as I am testing (with the valid password I began with copy/pasted into the form). I have to reset the userNoConsole flag as I am locked out. After the account is locked, and then unlocked (userNoConsole set = false) I have to restart the site before the "failed login attempts" begins to increment again.
I do have SQL Server Data Tools (I think that's what is referenced here) installed.
I had the same login issue with a fresh 7.4.3 install (same sql server, same OS, directly into IIS rather than through IIS express).
Is there any way that I can step into the umbraco code provided via nuget to debug (a source/symbol package)? I attempted to download the source code and step into it, but the nuget package assembly hashes do not match that of assemblies I build locally. I could point my local environment at those locally built assemblies, but that seems like an invalid test.
What other information can I provide to you to help in reproducing/debugging/fixing this error?
Great, now we have something to go on!
What are you doing in Global.asax.cs? We prefer you use
ApplicationEventHandlers
to do stuff on startupWhat is it currently, before you correct it? I can look into it.
The issue you link to indicates it's fixed though, so if you upgrade straight to 7.4.3 this should not be necessary.
Can you check these two properties on the UsersMembershipProvider are set to
useLegacyEncoding="true"
andpasswordFormat="Hashed"
? I'm assuming that's how they were set on your old version.It doesn't need to, is there a reason for that, that you know of?
Not sure, you can however build the 7.4.3 source and use the output files in
src\Umbraco.Web.UI\bin
to drop into your bin folder. You can then attach the debugger to your running site with those binaries and debug the Umbraco source.We have an error handler in the Global.asax.cs:
I'm not certain that it's ever hit. I'll attempt the upgrade without that modification. Based on what I detail below, I don't think this is related.
This is the UsersMembershipProvider tag prior to the upgrade:
It remains unchanged after the upgrade. I believe that this is the same problem mentioned in this post. I do not have a value for useLegacyEncoding.
I'm aware that the ticket is marked fixed, but I'm still seeing that issue when performing the upgrade to the newest version (7.4.3) in nuget:![enter image description here](/media/upload/14ba01eb-42fc-43b4-a990-7b051e27bf99/DB%20Error.PNG)
The MachineKey value (I have a validationKey and decryptionKey) is, according to the MSDN Documentation, used to validate forms authentication, and to encrypt and decrypt data.
Additionally, it seems that if I do not run the site and login before I perform the upgrade via nuget (thus caching login credentials in my browser) I'm prompted to login to authorize the upgrade, which fails with this issue. Remember, I've removed the redirect rules from my web.config, so I do not know how that could be the issue.
However, manually adding the
useLegacyEncoding="true"
to the UsersMembershipProvider allows me to login after the upgrade.The fact that the UsersMembershipProvider's type isn't being modified makes me suspect that the issue is that the whole tag isn't always correctly being updated/modified by the upgrade process.
It looks like there are a number of issues with the upgrade not correctly applying certain changes, both to the database (keys not being removed, columns being added too early in the process) and the codebase (the UsersMembershipProvider key in the web.config). Hopefully these details will help anyone else running into these issues, and provide a starting point for the dev team to look into fixing the upgrade package, both in nuget and via the downloadable zip files.
Okay, so you fixed it by adding
useLegacyEncoding="true"
?I'll look into the config transform and the database upgrade.
@Ryan:
Alright, I had a look at this, are you sure that adding
useLegacyEncoding="true"
fixed the problem? This is the default value if the setting is missing. We don't add or change this setting during upgrades on purpose, we don't want to break people's installs if they've set it to "false".Would it be possible for you to get me a backup of your database? Could you email a WeTransfer or Dropbox link at [email protected]? Then I can look into why your database upgrade doesn't work as expected.
Also, if you can zip up the website and email it me too, I can look at why you explicitly need to add
useLegacyEncoding="true"
.Thanks!
Hello Sebastiaan
where do you put this set ?
im stucked with this also ... changed database and ...capuut ... stucked in login window
https://www.dropbox.com/s/7s256kv3nbdll92/Screenshot%202016-07-29%2009.39.41.png?dl=0
and error in console ... https://www.dropbox.com/s/xl56xumbe9t14r8/Screenshot%202016-07-29%2009.53.51.png?dl=0
any solution yet ?
thank you
AS
after all i had the old database :( ...so it worked
when i tried to change the database same problem trying to migrate to a new database ...
any solution on this ?
thank you
Hi,
I think I've just had something similar - it was a situation where I wasn't sure of the password.. but what had happened was I'd left open a login screen and stopped the website. It had been down for some time (so any keep alive pings etc would have failed).
When the site came back up I tried logging in on the tab I'd left open in the browser. It didn't work - until I refreshed the page. It seemed to work - it was replying with incorrect user name / password.
Had me confused for a good ten minutes. Could this possibly be what everyone is doing? Can this be fixed by having some JS on the login screen hide the login and request the page to be refreshed if the server can't be reached?
Might be a red herring but it sounds too similar.
Steve
Hello Steve ... could you help me ?
im stuck in login window when i changed the database
https://www.dropbox.com/s/7s256kv3nbdll92/Screenshot%202016-07-29%2009.39.41.png?dl=0
and error in console ... https://www.dropbox.com/s/xl56xumbe9t14r8/Screenshot%202016-07-29%2009.53.51.png?dl=0
Thank you
Angelo
My 5 cents on this rather old topic.
I too had 400 bad requests, with username and password being sent, but with empty 400 response.
User has userNoConsole on true, I set it to false. No luck still.
Did a restart on IIS of the site and a full refresh in the browser and it started working.
Partial Solution?
I upgraded from Umbraco 7.4.3 to 7.5.2 using Nuget. I then used Visual Studio's Web Deploy to build and deploy to a localhost install using SQL Server CE 4.0 and to my hosted test environment using Microsoft SQL 2014. In both cases I received "Login failed for user [admin]" when the redirect upgrade was trying to start.
The solution in my case was to download the Umbraco 7.5.2 zip file and copy the bin, Umbraco and Umbraco_client folder contents to my build environment. After building and deploying, everything is working as it should.
The only conclusion I can draw is that the Nuget upgrade broke something.
Hi ,
I have applied the suggestions given above to fix the Bad request error. I am unable to pass through the AuthUpgrade page.
I think its quite some time this issue was raised and many replies are there over here.
By any chances the issue has been fixed.
If yes, can you please update the solution to this?
Thanks. S.K. Sreeraghavendra
I encountered the same issue and tried a number of the above but none were working. The website was also in production (was working fine in staging and development) so re-installing was not an option.
To debug I was using ARC (or Postman) and posting directly to the login URL, ex:
The password used in the example above is the hash equivalent of 'default'. Login would tell me it should be sent in plain-text, but the above worked.
If the problem exists, you will receive the 400 - Bad Request response and no more info in the response.
So firstly I set userNoConsole to 0 in the umbracoUser SQL table, but this didn't change anything.
So I added debug="true" to to get more information on the error.
I re-sent the POST request and it now works well
I remove debug="true" and it still works well.
I cannot understand what was causing the issue (this was working yday but not today), but the above sequence resolve the issue for me.
Hope it helps someone.
added debug=true to what please?
debug=true is a web.config setting that enables Umbraco to display the errors and traces in the webpage.
In order to have these errors in a webpage, you also need to add the URL parameter ?umbDebugShowTrace=true to that webpage.
Okay Im having this issue was working fine until last night and have tried all of the above with no luck even went down the forgot password route.
The site im working on is due to go live monday please help
Follow Mihai's steps... if all else fails...
https://our.umbraco.org/projects/developer-tools/umbraco-admin-reset/
HTH
Steve
Okay so this worked:
https://our.umbraco.org/projects/developer-tools/umbraco-admin-reset/
How ever when I try to login back in with the correct user details I cant :(
Okay this is beyond me I basically have to use: https://our.umbraco.org/projects/developer-tools/umbraco-admin-reset/
Everyday as for some reason the admin keeps changing the username back to Admin which causes the login to fail I dont understand what is causing this?
Please help
Okay regarding the above its some weird caching issue where basically after certain amount of time is reverting back to the admin user set by the above mentioned .dll file
I am currently developing an Umbraco 7.5.7 site, so I always start the site from within Visual Studio. Database is MS SQL Server 2014. It was working fine yesterday, i.e. I could login to backoffice with my only admin user .
Read the whole topic, and REALLY tried everything. I am using the "start" button in Visual Studio to start the site. My admin user cannot login but my other user who is not admin can. I get the "400 bad request" response like all the other people here did.
Both the admin and non-admin users have the same password so their password hash is also the same.
"userNoConsole" never becomes "1" in my case.
I tried the "umbraco admin reset" by putting the DLL into the bin folder, stopping/restarting project (making sure IIS Express is also closed and reopened). It is supposed to set the userLogin to Admin and password to Admin1234! . It can change the userLogin to "Admin" but password does not change at all! It remains what it was and I still can't login.
By the way when I login with my non-admin user, I can change that user's password without any problem. Only thing that is problematic is the user with id=0.
I even tried to debug the "umbraco admin reset" project but there are no errors, no exceptions are thrown, no errors in UmbracoTraceLog file...
I have no other option left than dropping and recreating the database from an older backup.
Edit: I worked the problem around following these steps:
1) As I said, I had a non-admin user which could login. I set its userType to 1. I noted down its "id" (in my case it was 1).
2) I opened "umbracoUser2app" table for editing. This table holds information about places each user can access. There were seven lines for user 0 because that user is admin, and two lines for user 1 (namely content and media). I added other app names for 1 as well, so in the end user 1 had the following apps: content, developer, forms, media, member, settings, user.
3) Now I can login with my other user and access everywhere in the backoffice.
So if you at least have another user other than the admin, you can follow this approach I suppose. I didn't try creating user manually directly on DB, perhaps it works too. I hope this at least solves some of the problems that we experience until developers can actually reproduce it and find out the real cause.
Are you using a SQL CE DB in the backend?
Steve
Hi Steve,
It is MSSQL 2014, I edited my post to reflect this information. I also added a workaround to the post.
Which two lines were missing for admin - was one of them content?
I believe none. Admin (user id = 0) had it all: content, developer, forms, media, member, settings and users. I added those to my other user as well.
Hello guys. I went through this today. After a period the login has expired. I do not know how in the database the column userNoConsole changed to 1. The solution was to change userNoConsole to 0, reset IIS and recompile. I also had to change the password in the database with the script below:
Umbraco version 7.6.3 assembly: 1.0.6361.21154
My turn today. I think I just forgot the password. Anyway, want to add that if you change the password in the database remember new passwords should be 10 characters long (not sure when this change happened). I couldn't get my new password (default) to take so changed it to "defaultpassword" and it worked:
Login: admin password: defaultpassword
Good luck.
OK, so I'm new to Umbraco and I had this problem too. Here's where I think the main problem might be.
When you setup Umbraco in creates a user account with userName = [whatever you put in the username field] and userLogin = [email address]. If you create another user account the userLogin = [whatever you put in the username field], which is not the same as how the initial setup admin user. This means that the initial/admin user will have to use his email address to log in and other users that are added afterwards CANNOT use their email address to login.
And then to top it off, the user account system does NOT use "OR" to lookup the user. Ideally (in my opinion) there should be unique index on userName, userLogin, and userEmail and then you should be able to use any one of those three to login to your account. Assuming that's not of interest to the primary developers, I think the UI should at least be a little more helpful in helping you know how the data your entering is going to be stored and used during the login process and I think that the behavior should be consistent. If userLogin = emailAddress during initial creation, then make it be the same way when you enter new additional users.
Now I'm not talking about "membership" here, only backoffice users. I haven't even tested the membership system yet.
Just had the same issue.
In the end read this post. Used the email adres and could log in :)
Might be something the Umbraco UX expert wants to look at...
I had same problem. I logined by email instead of username and I logined successfully
This is a long thread so I haven't read every single comment so excuess me if what I'm about to say is not relevant.
The otherday I was installing Umbraco and after entering all the information in to the wizard screen I kept getting Login Failed for umbraco user....
It was very strange, but it turns out becuase the password to the db connection string had a & in it the umbraco installation failed to read the password in correctly, as soon as the password was changed to one with out a & in it, the error went away.
Is this a bug in Umbraco? anyone else had anything similar?
Hi Ayo,
Not sure that is the bug others are reporting above but it is, indeed, a bug!
It's already been reported here but I've added some notes now I've recreated it. Might be one we can tackle at the UK Umbraco Festival bug bash.
http://issues.umbraco.org/issue/U4-9214
Steve
I urgently need help with this I have just upgraded to Umbraco 7.13.1 from 7.2.1 following https://our.umbraco.com/documentation/getting-started/setup/upgrading/general and can not login to authorize the upgrade having tried everything below:
Legacy encoding: https://stackoverflow.com/questions/43947207/umbraco-7-6-1-upgrade-login-issue-400-bad-request
Changing password settings: https://offroadcode.com/journal/dev-talk/tips-to-login-issues-with-umbraco-upgrades/
Admin reset: https://our.umbraco.com/packages/developer-tools/umbraco-admin-reset/
Updating database: UPDATE userNoConsole = 0 etc with no luck
Are you getting an error - check the dev console.
Often worth clearing your cookies / trying a fresh browser. Sometimes the user cookies seem to get corrupt on upgrades which stops a login working.
Error in the dev console is:
POST http://website.co.uk/umbraco/backoffice/UmbracoApi/Authentication/PostLogin 400 (Bad Request)
Have tried hard refresh even a different browser and still the same
Are you login in through username + password or through email + password? Try both please.
I have tried both and still the same issue I'm afraid.
How did you upgrade - nuget or file copy?
Sounds like you're missing some files!?
I went for the file copy approach following these instructions: https://our.umbraco.com/documentation/getting-started/setup/upgrading/general
Copy the following folders from inside the .zip file over the existing folders in your site:
/bin /Umbraco /Umbraco_Client
Any file in the /Config folder The /Global.asax file The web.config file in the root of your site (Important: make sure to copy back the version number, and the connection string as they were.) In rare cases, the Web.config file in the Views folder
Okay so I have gone through the extremes of creating a local version of 7.2.1 both database and files then updated to 7.13.2 using nuget and falling at the same hurdle this is so frustrating surely it shouldnt be this painful.
Also had this issue https://issues.umbraco.org/issue/U4-9739
This is the url which looks a bit crazy: http://localhost:/umbraco/AuthorizeUpgrade?redir=%2finstall%2f%3fredir%3dtrue%26url%3dhttp%253a%252f%252flocalhost%253a58238%252f#/AuthorizeUpgrade?redir=%2Finstall%2F%3Fredir%3Dtrue%26url%3Dhttp%253a%252f%252flocalhost%253a58238%252f
Database user is also fine and doesnt have the userNoConsole issue. Please help
This reply on sorted it for me. Wow! https://issues.umbraco.org/issue/U4-4796
Rasmus Lynggaard 07 Apr 2016, 07:53:04 I encountered the same problem, and it turned out to be a lowercase rule in the IIS URL rewrite module. Umbraco, for some reason, have some casesensitivity. I found a workaround at http://www.wiliam.com.au/wiliam-blog/iis-url-redirects-to-lowercase-and-umbraco-cms
Excerpt:
You saved my ass! Cheers man
is working on a reply...