Moved admin authentication to after user validation. Hence the Python script now attempts to validate with the REST endpoint as the current user. Then, only if the current user credentials are valid, does the script log in as the administrator and change the user's credentials.