Unable to login after switching to UsernamePassword authentication and adding administrator

Hellow,

I followed instructions here: https://octopus.com/docs/administration/authentication-providers/active-directory-authentication and here: https://octopus.com/docs/administration/managing-users-and-teams/resetting-passwords (I need to migrate servers and Active Directories), but I am unable to login once I create the new administrator.

I’m on Octopus 3.4.13

Hi Joe,

Thanks for getting in touch! After you created your new administrator user, what error are you getting when you try to login? Or are you able to login, but you don’t have any permissions to do anything?
Did you run the below command from the second documentation page you linked? This will make the user into an administrator (replacing with your user’s details):

Octopus.Server.exe service --stop
Octopus.Server.exe admin --username=YOURUSERNAME --password=YOURPASSWORD
Octopus.Server.exe service --start

I look forward to hearing back!

Kenny

Hey Kenny,

Yes I did this exactly, changed webAuthenticationMode to UsernamePassword and specified a username and password for admin. I even tried a few different usernames and passwords. I just get unable to login as if the credentials are bad. Being as I’m doing this on the server with plaintext I’m positive they are correct.

Hi Joe,

Thanks for following up. As you said you were migrating your Server, is the login failing on the old server, or the new one?
Is the Sign in with a domain account option present on your login page? Changing the authentication-type to Username/Password will disable integrated login, and would remove that option.
Could you confirm the admin user you created with that command has been added to the database by running the following SQL query?

SELECT * FROM dbo.[User] WHERE Username='YOURUSERNAME'

If the admin user exists in the database as expected, could you send us the Server Log (located in C:\Octopus\Logs in standard installations)? That should then shine some more light on what could be the issue :slight_smile:

Best regards,

Kenny

Kenny,

I did this on the server pre-migration, so the existing server. I first changed the authentication method to UsernamePassword and then added the administrator.

I did verify the user I created was added to the databases (see screenshot).

So I did the following:
Octopus.Server.exe service --stop

Octopus.Server.exe configure --webAuthenticationMode=UsernamePassword

Octopus.Server.exe admin --username=OctoAdmin --password=YOURPASSWORD

Octopus.Server.exe service --start

I’ll have to wait a couple hours to verify what it says again when I try to login, but what I remember it doing was just bringing up the yellow warning box saying username and password were invalid. During this time I also tried to login with my domain credentials and that did not work (as expected).

Once It was not working to revert back I stopped and did :
Octopus.Server.exe configure --webAuthenticationMode=Domain

Everything worked as it always had. OctoAdmin still does not work.

Octo.PNG

Here is what happens when I try to log in.

octo2.PNG

Hi Joe,

Thanks for that additional information. Your process looks completely correct, and the user exists in the database, so I don’t see any obvious reason why it wouldn’t be working. The only thing I’ve seen previously that has caused this error is the password having a special character that isn’t supported (ie #). However, there have been some updates and enhancements to the authentication system since Octopus 3.5, including being able to have both Username/Password and integrated AD simultaneously turned on. Would you be willing to try upgrading to a newer version, as that may help?

Let me know how you go or if you have any questions!

Kenny

Yes. That was going to be my next try. It appears our license can take us up to 3.7.5.

Thanks,
Joe

Having much the same luck Kenny.

I ran the follow:

Octopus.Server.exe service --stop
Octopus.Server.exe configure --usernamePasswordIsEnabled=true
Octopus.Server.exe service --start

Created a user from the UI.

octo3.PNG

octo4.PNG

I also made sure my password had no special characters at all.

Hey Kenny,

Looking into the server logs it would appear that Octopus is still checking the directory for the user.

Thanks,
Joe

Kenny,

I managed to get it working by disabling active directory and logging in. I then re-enabled it and can still log in.

Thanks,
Joe

Hi Joe,

That’s great to hear! I wasn’t having any success replicating this behavior, so I’m glad you got it working :slight_smile:

Don’t hesitate to get back in touch if you have any further questions!

Best regards,

Kenny