Moved authentication code.