Copied to clipboard

Flag this post as spam?

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


  • Edgar Arroyo 16 posts 157 karma points
    Apr 27, 2019 @ 03:39
    Edgar Arroyo
    0

    Moved site now I can't login, invalid password

    Is there a way to reset the password for user id -1? I have seen admin password reset on v7 but nothing on v8. I am stuck with a non-working password. How can I avoid this when I need to move the website?

  • Marc Goodson 945 posts 6285 karma points MVP 4x c-trib
    Apr 27, 2019 @ 10:45
    Marc Goodson
    1

    Hi Edgar

    A couple of things... you may not be able to login after the move of your site, if your site can't connect to your database - are you using a separate SQL server or SQL CE?, and if using SQL Server, has your database moved too? and can your new site location connect successfully to the database?

    Secondly, the password is stored as a hash in the database, in theory, the hash algorithm type, used to generate this has 'could' be different between environments, particularly if a different version of the .net framework is used for the site. There is a detailed explanation here:

    https://shazwazza.com/post/umbraco-passwords-and-aspnet-machine-keys

    ...but I think in V8 the 'hash algorithm' used for the password is also stored in the database for each user, so this shouldn't be an issue!

    Finally in V8 the UserLogin and UserPassword details are still stored in the database, so executing the following SQL against the db:

    SELECT TOP (1000) [id]
          ,[userDisabled]
          ,[userNoConsole]
          ,[userName]
          ,[userLogin]
          ,[userPassword]
          ,[passwordConfig]
          ,[userEmail]
          ,[userLanguage]
          ,[securityStampToken]
          ,[failedLoginAttempts]
          ,[lastLockoutDate]
          ,[lastPasswordChangeDate]
          ,[lastLoginDate]
          ,[emailConfirmedDate]
          ,[invitedDate]
          ,[createDate]
          ,[updateDate]
          ,[avatar]
          ,[tourData]
      FROM [dbo].[umbracoUser]
    

    will allow you to find your -1 user, and check if they are locked out...

    enter image description here

    You can then update this row in the db accordingly with an UPDATE statement

    for example:

    UPDATE umbracoUser set userdisabled=0, userLogin='yourName@yourEmail.co.uk', userPassword='k8xXdoQ5Tzv8HwDzq7ivTQ==8FubB0cjfwpEnKQCZcQ7Pk16Dt+WxDlILG2/fZ4G0RI=', passwordConfig='{"hashAlgorithm":"HMACSHA256"}',securityStampToken=NULL, lastLockoutDate=NULL, userNoConsole=0, failedLoginAttempts=NULL where id=-1
    

    should reset the login to be: (perform a site restart/application pool recycle first)

    UserName: yourName@yourEmail.co.uk Password: abc123abc123

    regards

    Marc

  • Edgar Arroyo 16 posts 157 karma points
    Apr 27, 2019 @ 21:20
    Edgar Arroyo
    1

    Ok, thanks. I will try this when I get a chance. I reinstalled it on the new machine and copied all the models, controllers, partial views, templates and document types. I also had to add the Members changes (added fields like First Name, Last Name, Address 1 + 2, City, State (dropdown with all 50+ states), Zip Code and Phone. Wasn't fun but wasn't impossible. Good thing I am setting up a new website and I didn't have any members yet. When I get a chance, I will backup the existing website and database, then I will restore the old backups and try this and report back that way we can have a post with a solution.

    Thank you for your time.

  • Edgar Arroyo 16 posts 157 karma points
    May 18, 2019 @ 19:37
    Edgar Arroyo
    0

    I ended up reinstalling it. Never had a chance to test this, sorry, and thank you for your help.

Please Sign in or register to post replies

Write your reply to:

Draft