What are the details of opening a cockpit door from the outside?
I'm going to explain this for the Airbus (also known as the Cockpit Door Locking System or CDLS):



  How exactly does the person on the inside "cancel the unlock
      process" (Press a button, flip a switch, enter "counter code",
      etc...)


If the code is entered for an emergency external opening, the pilot has 30 seconds after the request period to toggle the door button to lock to deny the request or the door will unlock. It pops back the the 'Norm' position automatically.

  It seems there is a delay before the door opens. Is this
      correct? What's the duration of the delay?


30 seconds, unless the lock button is pushed, in which case the request is inhibited for 5 minutes.

  What are the "authority levels" of codes? Which levels exist, what do
  they mean? What is the confidentiality policy regarding those codes in
  theory and practice? (Who gets what authority level code officially?
  If
      stewards/stewardesses are not allowed to have the codes do pilots
      usually pass them on anyways?)


There are indeed two codes, but I believe the normal access one is optional. The (optional) normal code just chimes the cockpit for an opening request, while a secret code to the best of my knowledge is shared among the crew to request emergency access. "There are two different access request types : “Routine” and “Emergency” access request." These are however internal airline policies and differ from airline to airline, and I've read in some cases that they might even have the same emergency code across the fleet. In any case, the pilot(s) can still decline access.




Here is a video about cockpit door as well.

Source, Page 37 onwards. While the source suggests that the time can be changed, most sources I've read refer to 5 minutes and 30 seconds as the standard times.