General authentication improvements