Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 08:10
    Lasse
    0

    Localhost umbraco failed to login

    Hello,

    Recently i am unable to login to localhost:xxxx/umbraco.

    EDIT:

    I just noticed in the console, i am getting an error.

    enter image description here

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 10:02
    Brandon Osborne
    0

    Hello There, Lasse,

    I've seen this issue before. There are a couple of usual suspects:

    1. Do you have any rewrite rules defined in your web.config file?
    2. Are you using any custom HTTP modules?

    A lot of times adding useLegacyEncoding="true" to your usersMembershipProvider will sort out this issue.

    <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" useLegacyEncoding="true" />
    
  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 10:11
    Lasse
    0

    Changes i've made from last working til now, is installing signalr, and added a startup.cs

    i did try to revert my changes to a previous commit, that did not help.


    Earlier today i could login on my hosted domain, but after changing the password i am totally locked out from umbraco. i have also tried to add the useLegacyEncoding, did not work either

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 10:32
    Brandon Osborne
    0

    Hmm... it sounds like you may literally be locked out. What does your latest log say? Look in ~/App_Data/Logs/ and open the newest Log. Also... have a look at the UserNoConsole column in the umbracoUser table. It should be set to false or you won't be able to login.

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 10:53
    Lasse
    0

    The log says a lot, but nothing i can get any use of, i have tried so many things so far, i actually think i am locked out now


    EDIT:

    i am no longer locked out, i once again can login on my hosted server, but on localhost i am still not able to login

    I have narrowed the issue down 20 files, resetting to a previous commit makes me able to login again, it is something i've done when installing signalR,

    this is my web.config, could it any of these? enter image description here

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 11:11
    Brandon Osborne
    0

    Hmmm.... replacing UmbracoDefaultOwinStartup with SignalRStartup could have done it.

    Could you post your latest log? Also, what does your localDB say in the UserNoConsole column of the umbracoUser table for your account? If it says true it means you're locked out and you just need to set it to false.

    If all else fails, you may also want to simply pull down your database from your server and use it locally just to get you up and running again (make a backup or copy of your localDB though).

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 11:28
    Lasse
    0

    I run on a hosted DB, and userNoConsole is set to false (can't remember was it was when the error occurred)

    Pastebin - Log

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 11:41
    Brandon Osborne
    0

    Well... if you're using the same database on prod + dev, that definitely isn't it. :/. Nothing in the log looks bad. Are there any differences in the web.config between prod and test?

    Probably totally unrelated, but you should significantly lower your umbracoTimeoutInMinutes and set <keepUserLoggedIn>true</keepUserLoggedIn> in your ~/config/umbracoSettings.config file.

    This is an annoying error that you're facing. I've run into it a couple of times before & it seems like it can occur for countless obscure reasons.

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 11:53
    Brandon Osborne
    100

    Also... just for kicks and gigles: locally, if you set owin:appStartup back to UmbracoDefaultOwinStartup (presuming you didn't delete that code), does it work again?

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 11:58
    Lasse
    0

    if you set owin:appStartup back to UmbracoDefaultOwinStartup - Then i can login on localhost, but then my signalR doesn't work :s

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 12:08
    Brandon Osborne
    0

    I figured that would happen. The good news here is we've identified the problem. There's something wrong with your signalR code (specifically on localhost). Once again for kicks and giggles put it back to SignalR and completely turn off your firewall. If that doesn't work, then leave your firewall turned off (really shouldn't have to do that, but I'm just trying to eliminate any remotely possible problems) and step through that SignalR code and make sure everything being sent / received is valid & what you're expecting.

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 12:10
    Lasse
    0

    well, my startup.cs (signalr) doesn't really do much, so i suppose i need to add something in the file, to "startup" umbraco ?

    enter image description here

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 12:17
    Brandon Osborne
    0

    Blah... I wasn't expecting that. It's set to SignalR in your prod web.config & it works?

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 12:20
    Lasse
    0

    yes, i couldn't find any tutorial on how to get signalr to work with umbraco, so i had to try, and this initialize my signalr, but apparently not my umbraco :D

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 12:24
    Brandon Osborne
    0

    I use signalR in Umbraco... but not in the backoffice, so it's a bit easier (I have a lil' chat app I wrote some years ago and it works well). Your code should work, as it does on prod. That's what is so confusing. Just out of curiosity, on the server are you using HTTP or HTTPS? On prod are you precompiling the code or just copying the same development code from your computer?

  • Lasse 49 posts 161 karma points
    Jun 11, 2019 @ 12:26
    Lasse
    0

    If you got time, could you explain how your signalr works, if it is not backoffice?

    i run HTTP for now on the server, soon it will be HTTPS, i precompile to a folder and then FTP the bin/release to my server. if that is what you are asking for

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 11, 2019 @ 13:16
    Brandon Osborne
    0

    Sorry for disappearing there. I had a meeting.

    Hmmm... this wouldn't be the first time I've seen IIS Express mess things up. I want you to try two things, if you don't mind.

    1. Precompile locally to your own filesystem, then set up your local IIS (not express) to run the page from http://localhost (or setup something w/ your hosts file if you prefer). Let me know if that works.
    2. Don't precompile, but just copy all of your dev code somewhere else on your filesystem & setup IIS to use it.

    If #2 works then IIS Express is mucking things up & you just need to Project => Properties => Web and change Servers to Local IIS & set that up properly and you should be rid of this stupid problem. :)

    As for my lil' chat app. I have a simple webAPI that works as the "middleware" and signalR is used to just send the messages to/from the webAPI. Their are two clients, one is a macro that I include on each of my pages (this is what the customer uses), When a customer messages from the macro, it sends it to the webAPI & signalR sends it to a WPF admin app that is actively listening on port 80 on my local computer (I'd love to make a mobile app for that, but never had the time, so I ended up using ZenChat because I know I'll never find time to make a mobile app & am not paying someone else to do it :) )

  • Lasse 49 posts 161 karma points
    Jun 12, 2019 @ 05:06
    Lasse
    0

    Hi, i will try that later today, never really worked with IIS before, i just quickly tried to add both owin:startup for signalr and umbracodefaultowinstartup, it overrides the value from the first to the last one of this property, so that is not a solution for me to use both that way at least.

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 12, 2019 @ 07:21
    Brandon Osborne
    0

    Hiya Lasse,

    Yeah... that definitely couldn't work. I can't even imagine how that would have exploded... probably a duplicate entry error, I suppose. I've worked with IIS over 20 years now. We can do a screenshare later, if necessary. It would only take me all of 5 - 10 minutes to get it working for you.

    I do have to say though, it is a little strange to want to use SignalR in this specific place. What is it you're trying to accomplish exactly? I probably should have lead with that question. :o)

  • Lasse 49 posts 161 karma points
    Jun 12, 2019 @ 07:35
    Lasse
    0

    Let me get it out of the way, even though it has nothing to do with my issue :D

    My project is to create a website with different data tables, which is going to be showed on a tv monitor in the company. The TV will then access the website, login and then go to the view it needs to display, and stay there forever, that is the only thing it should show all day.

    The project is build up with MVC, meaning to get all latest changes i need to perform a refresh to trigger the controller. The TV is using it's own build-in browser which is verrrrryyyyy slow, especially to load libraries and get everything together to show it correctly.

    Something that would take less than one second on a pc, takes 10-20 seconds on the monitor.

    Currently the way i am interpreting the controller trigger is with a <meta http-equiv="refresh" content="3600"> on the view.

    I figured, with live data feed i would be able to prevent to update the page every now and then, to get the latest data

    pardon my English, but do tell if you have any suggestions, i am always ears

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 12, 2019 @ 09:10
    Brandon Osborne
    0

    I'm so glad I asked you! 😊 This has everything to do with your current problem. :) The membership provider you are using is the wrong one. That is for umbraco users (admins, writers, et cetera). Since you want to login & display a view, if you modified the UmbracoMembershipProvider that's for members (not admins, just your end users that need to login to view a view.

    However, you don't really need SignalR at that stage in the game. You'd probably have a much easier time logging in with AJAX (a jQuery $.ajax call that automatically logs in whatever user(s) that you need to login. You really don't want to go through the trouble of writing your own custom membership provider when simple javascript will do the job.

    At that point you can once again use AJAX to refresh the pertinent part of the page (make sure to use partial views & [ChildActionOnly] to keep what you are refreshing as minimalistic as possible. Of course, at this stage in the game you can also use SignalR. It would definitely be the fastest & cleanest approach, but also a bit more difficult to code. Personally, I would probably go the SignalR route, just because it's cooler, but AJAX will get you to the finish line faster.

    No worries about your English! 😁 I left the US more than ten years go... I spent many years in Europe, 1 year in Asia, now a little more than 2 years in Latin America. I know how to say I'm sorry in more languages than I care to count anymore. lol I'm in a constant state of "lost in translation!"

  • Lasse 49 posts 161 karma points
    Jun 12, 2019 @ 09:14
    Lasse
    0

    the login is standard umbraco utility i've just implemented, not to chappy it does it's job. How should i approach my problem from here? maybe it would be easier to take the conversation to another platform, my main problem was why i couldn't log into umbraco, and the issue has been discovered i suppose, the signalR thing is a whole other issue isn't it?

  • Brandon Osborne 38 posts 161 karma points c-trib
    Jun 12, 2019 @ 09:24
    Brandon Osborne
    0

    Oops... I think I confused myself w/ an earlier post that I wrote. You're not messing with the either provider, or at least not that I'm aware of, only a custom startup. Sorry about that. So, we're back to the original, why does it work on your server, but not in dev. It could have something to do with IIS Express like I was mentioning previously.

    I can walk you through setting that up with your local IIS instead of IIS Express. You can add me on Skype, if you like. I'm coderPros there.

  • Weber 12 posts 36 karma points
    Jun 12, 2019 @ 09:16
    Weber
    1

    Hi

    For hooking into Umbraco Startup class you need to inherit

    Then change startup in web.config to your own.

    [assembly: OwinStartup(typeof(StartHandler.MyStartup))]
    namespace StartHandler
    {
        public class MyStartup : UmbracoDefaultOwinStartup
        {
            public new void Configuration(IAppBuilder app)
            {
                base.Configuration(app);
                //own startup functions goes here
                // THIS IS WHERE YOU INIT SIGNALR
    
    
            }
        }
    }
    
  • Lasse 49 posts 161 karma points
    Jun 12, 2019 @ 09:24
    Lasse
    0

    Thank you, now both things work. very nice

  • Weber 12 posts 36 karma points
    Jun 12, 2019 @ 11:15
    Weber
    1

    You are welcome :)

Please Sign in or register to post replies

Write your reply to:

Draft