implement authentication plug