With the release of Windows Server 2012 R2, Microsoft added a new feature for the RD Gateway role called Pluggable Authentication.
“…Remote Desktop Gateway pluggable authentication. Both customers and partners asked for a more flexible way to authenticate users connecting from the Internet. RD Gateway pluggable authentication allows custom authentication routines to be used with RD Gateway. This can provide custom two-factor authentication and works seamlessly with Remote Desktop Web Access (RD Web Access) or RDP file resource launching (even when using third-party browsers with RD Web Access)…”
In addition to that, Microsoft released sample code to explain the available Remote Desktop Gateway (RD Gateway) authentication and authorization models and demonstrate how to deploy authentication and authorization plug-ins for RD Gateway.
More info and download: http://code.msdn.microsoft.com/Remote-Desktop-Gateway-517d6273/view/Reviews