Authorization queries based on realm