If you bought an iPhone on eBay or from another person, then you have to enter the Apple ID and password but that's exactly what we don't have access to. So, in this case, you can unlock the iCloud account by putting your phone in recovery mode or by using a third-party tool 4MeKey to bypass the Activation Lock. For this,
If you forgot your Apple Id password and unable to unlock your iCloud account, then follow the steps below:
And if you don’t possess the iPhone passcode, then reset your iCloud password by enabling two-step verification. For two-step verification, enter the code sent on your iPhone messages and create a new password.
FAQ