Querying attributes from Active Directory using ADFS with a 3rd party Identity Provider

I know there are a lot of other blogs explaining how to query Active Directory for attributes. There’s even a rule template for it (Send LDAP Attributes as Claims). The only problem with this rule template is that ADFS requires that you authenticate via Active Directory, which in turn issues you a WindowsAccountName (http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname) claim. What if…