1. A computer-readable medium having instructions stored thereon that, when executed by a processor, cause the processor to perform authentication for real-time communications (RTC), the performing comprising: receiving a request from a browser application for web authentication of a user; performing the web authentication by a security provider by reaching a first resource, wherein the security provider determines a security principal for the user; executing a security Groovy script to obtain an identity mapping from a second resource different than the first resource, wherein the identity mapping maps the security principal to an Internet Protocol (IP) Multimedia Subsystem (IMS) identity; and providing the identity mapping to a runtime Groovy script.