Authentication functions finished.