How is a toilet flange attached to new flooring?
You should screw the flange through the floor, through the subfloor, and ideally into some kind of framing.  Use all holes.  I don't fully understand the reason for this, but all flange manufacturers are very clear that you need to screw the flange down.