Energy trading is a key feature of the emerging smart grid system. In this paper, we propose an energy allocation mechanism for energy trading among competing consumers and prosumers, i.e. agents, in a microgrid. The proposed mechanism is modeled for rational agents with hidden private information, aiming to optimize self-utility and payoff. We achieve this goal through the presence of a central impartial aggregator whose aim is to accomplish an efficient, price uniform, individually rational, and budget balanced trading among agents.