Can't get past login screen I have a Mac that I bought from work during a hardware refresh, which was previously joined to a domain. Booted using cmd-R and reset the Admin password. Logged in, started deleting the old work account. Got some Keychain errors.

Came back a few minutes later and the screensaver was on and password protected. Tried to log in, and would get the spinning cursor in the password box for about 30 seconds, then nothing. Username and password box ready for text entry again.

So I restarted, tried to log in, same behavior. So I restarted into recovery, reset the password again, same behavior. Confirmed password is definitely correct - when an incorrect password is entered as a test it is rejected straight away.

Thinking about what I had changed, I booted into single user mode and disabled Wi-Fi service at startup. Same behavior.

Other things I have tried:


Reset password multiple times
Repaired permissions on disk / ran First Aid in recovery mode
Reinstalled OS X form recovery mode
Boot into Safe Mode
Ran a file system check in single user mode
Tried to force unbind using dsconfigad but got error 10002


Is there anything else I can try? I don't need access to any of the data so I'm happy to wipe the drive and start over. I don't have access to another Mac to create a recovery disc, is there a way I can do it from here, having access to recovery mode? Any other options?
The system may have been joined to an Active Directory (or other kind) of network authentication domain that would make changing the local admin password not work for long.

On general principles I would save nothing on a computer that I bought from somewhere else. 

That said I would suggest:


Boot into Recovery Mode
Select Disk Utility
Reformat the hard drive (then quit Disk Utility)
Click on Reinstall MacOS


You will likely be asked to authenticate to your WiFi network and presented with the install screen of the macOS version that originally shipped with the Mac.

That should give you a clean slate from which to do as you please, including upgrading to a later version of macOS.