finished authenticate method