How do you open the golden gate in Kamoshida’s Palace in Persona 5 Royal?

Quick answer: Find the Book of the King, Book of the Queen and Book of Slaves, put them on the matching library shelves, and take the Kamoshida Gold Medal from the hidden room.
Show walkthrough (quest spoilers)
Find the books
The three books are spread around the third floor of the East Building, in side rooms near the library and the third-floor safe room. The Book of Slaves is in the room just south of that safe room. One of the rooms has a shadow that appears out of nowhere, so be ready to fight.
Read the shelves
In the library, use Third Eye to see three faint blue glows on the shelves. Each one describes a group: Kamoshida, the female students or the volleyball players. That tells you which book goes where.
Fill the shelves
Place the King book where it describes Kamoshida, the Queen book for the female students and the Slaves book for the volleyball players. A hidden room opens in the corner of the library.
Use the medal
Take the Kamoshida Gold Medal and the Map of the Tower from the hidden room. Use the medal on the locked golden gate. Past it is the fifth safe room. See the Kamoshida’s Palace walkthrough for the rest.
