Noticing this behavior in my Full Sandbox after refreshing it. Whenever a third party application is trying to loggin using OAuth Username-password flow it gets the below error 3 out of 5 times. But not everytime. Which means the credentials and code are correct otherwise it wont log me in at all times. Whenever there is a failure, I don't see any logs on the user record. On success I see a successful entry in the login history. The same happens when I try to login through cUrl or any other client.
{ "error_description": "expired access/refresh token", "error": "invalid_grant" }
Could this be due to the Sandbox refresh or some sort of performance issue? Not sure what I can do about this, and how to handle it.
Also another thing I noticed is that when refreshing a sandbox the "Connected Apps" (Create->Apps->Connected Apps section) don't get copied. However the Production consumer key and consumer secret seem to work somehow for that app in the Sandbox. That is confusing.