Is This Possible with Firebase Realtime Database

Hello Community,
I’ve been thinking if this is possible with Firebase
Suppose Using the Web Component I Request Firebase Realtime Database

https://<database name>.firebaseio.com/Bucket&Code:<alphanumeric code>

So whenever I want to Access Firebase it should Only give access to read & Write if the code is there
Please Note this is different from Aunthicated Firebase RT Database (Or this Guide: METRIC RAT AI2 - How to have Secure Rules on Firebase, and allow Auth Users to Read/Write )

If it is possible then How to make it ?
Thanks in Advance