Custom AD FS Rule for Office 365 MFA ActiveSync Exemption

We setup Office 365 with our RSA keys, and we are looking to exempt our mobile devices and outlook from MFA for now.  From what I understand we have to form a custom issuance transform AD FS claim rule.  I have tried creating one, without success:

    c:[Type == "", Value == "false"]
     && [Type == "", Value =~ "(/adfs/ls)|(/adfs/oauth2)"]
     => issue(Type = "", Value = "");

Open in new window

Does anyone have any ideas on the correct way to do this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
The one you posted above is not an Issuance rule, but should be configured as additional authentication rule on the O365 RPT. For example:

Get-AdfsRelyingPartyTrust "name of your O365 RPT" | Set-AdfsRelyingPartyTrust -AdditionalAuthenticationRules 'c:[Type == "", Value == "false"] && [Type == "", Value =~ "(/adfs/ls)|(/adfs/oauth2)"]   => issue(Type = "", Value = "");'

Open in new window

You will probably have to fix some whitespace issues if copying/pasting the cmdlet :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vasil Michev (MVP)Commented:
To further clarify, the rule above is the general "force MFA only on the passive endpoint" rule, which will make sure all browser based apps and any app that supports ADAL is forced to use MFA. It will not specifically allow only ActiveSync and Outlook, but other apps as well.

Another approach will be to use an issuance rule similar to the one below (in combination with the additional security rule above!):

exists([Type == ""])
&& exists([Type == "", Value =~ " SID"])
&& NOT exists([Type == "", Value == "Microsoft.Exchange.ActiveSync"])
&& NOT exists([Type == "", Value == "Microsoft.Exchange.ActiveDiscover"])
&& NOT EXISTS([Type == "", Value == ""])
 => issue(Type = "", Value = "DenyUsersWithClaim"); 

Open in new window

More info in this thread:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office 365

From novice to tech pro — start learning today.