How to add repositories to Red Hat Linux with and without a proxy

In a corporate environment it is common to limit Internet access – both for security and accountability. This is often accomplished by using proxy servers that enable access to the Internet after some sort of authentication, while inspect and log all traffic passing trough them. This way the company can, for example find the employee who downloaded the virus that wreak havoc within the corporate system (or at least the employee who’s credentials where stolen to do so), or filter the traffic, preventing access to well-known harmful sites to protect employee equipment.