{"id":1630,"date":"2013-03-04T22:18:57","date_gmt":"2013-03-05T07:18:57","guid":{"rendered":"http:\/\/www.cloudidentity.com\/blog\/?p=1630"},"modified":"2013-03-06T23:00:58","modified_gmt":"2013-03-07T08:00:58","slug":"want-multi-factor-authentication-when-accessing-web-services-try-aal-and-aad","status":"publish","type":"post","link":"https:\/\/www.cloudidentity.com\/blog\/2013\/03\/04\/want-multi-factor-authentication-when-accessing-web-services-try-aal-and-aad\/","title":{"rendered":"Want Multi-Factor Authentication When Accessing Web Services? Try AAL and AAD"},"content":{"rendered":"<p>Ah, what a day! The <a href=\"https:\/\/www.cloudidentity.com\/blog\/2013\/03\/04\/new-active-directory-features-in-the-windows-azure-portal\/\">news on the Windows Azure AD features in the Windows Azure portal <\/a>were on fire today <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" alt=\"Smile\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/wlEmoticon-smile5.png\" \/> if you missed them, <a href=\"http:\/\/blogs.msdn.com\/b\/windowsazure\/archive\/2013\/03\/04\/more-identity-and-access-management-improvements-in-windows-azure.aspx\">check this out<\/a> before going any further.<\/p>\n<p>The <a href=\"https:\/\/www.cloudidentity.com\/blog\/2013\/03\/04\/managing-windows-azure-ad-from-the-windows-azure-portal-3-add-a-co-admin-use-2fa\/\">phone-based multifactor authentication preview<\/a> is probably my favorite new feature. For details, <a href=\"https:\/\/www.cloudidentity.com\/blog\/2013\/03\/04\/managing-windows-azure-ad-from-the-windows-azure-portal-3-add-a-co-admin-use-2fa\/\">check out this walkthrough<\/a>; but in a nutshell,\u00a0 this new feature allows you to get selected users to authenticate with the directory by using both classic username\/password AND exchange security codes via SMS messages (or voice call) from their registered phones. I love it because of its simplicity, especially if compared with more traditional methods like smartcards or hard tokens. That allows slipping this extra check in the Web authentication flow very easily, technically it\u2019s mostly another redirect.<\/p>\n<p>Unfortunately, adding another authentication factor to Web services-based solutions is not as easy: that usually entails redeploying the clients, given that the logic for prompting the user for the extra factors, and actually pumping the results on the wire according to the characteristics of the method of choice. Right? RIGHT?<\/p>\n<p>Ehmmm\u2026 no. Or, at the very least, not necessarily! <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" alt=\"Smile\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/wlEmoticon-smile5.png\" \/><\/p>\n<p>Almost one year ago I wrote a <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/04\/04\/authenticating-users-from-passive-ips-in-rich-client-apps-via-acs-2\/\">long post<\/a> (surprised?) on the benefits of introducing a browser surface in the context of\u00a0 rich client authentication flows: luckily you don\u2019t have to read it all \u2013 the <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/04\/04\/authenticating-users-from-passive-ips-in-rich-client-apps-via-acs-2\/\">\u201cGeneral Idea\u201d section<\/a> holds the relevant info. In fact, I can summarize the entire thing in one sentence: <em>if you rely on a browser window for driving the authentication from the server side, you can enjoy in a rich client the exact same benefits you get when authenticating with a Web site<\/em>. Including NOT having to roll out a new client when adding extra authentication logic.<br \/>\nSounds too good to be true? I can prove that last assertion, by walking you through a very real scenario.<\/p>\n<p>Remember the <a href=\"https:\/\/www.cloudidentity.com\/blog\/2013\/02\/18\/microsoft-asp-net-tools-for-windows-azure-active-directory-visual-studio-2012-4\/\">ASP.NET Tool for Windows Azure AD<\/a>? It is a rich client (its UI lives within VS itself) which performs authenticated calls (to the Graph API, to create a ServicePrincipal for the app it is configuring) secured against AAD (via <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL<\/a>).<br \/>\nAs mentioned, yesterday AAD added the ability of enforcing multi-factor authentication. In a traditional Web services client world, the ASP.NET Tool for Windows Azure AD would NOT be able to take advantage of the new authentication flow: not without a redeploy of the client, or at the very least of the authentication libraries it uses.<\/p>\n<p>Well, guess what. <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL <\/a>does use a browser based flow to acquire from AAD the token it needs for calling the Graph. In yesterday\u2019s walkthrough I added to my test tenant an admin which requires the new multi-factor authentication. Why don\u2019t we try to use the ASP.NET Tool with that admin user, to put to test my theory that I\u2019ll be able to use the new auth flow with old bits.<\/p>\n<p>You know the drill: select the project, go in the Tools menu and choose Enable Windows Azure Authentication; then enter the test tenant domain.<\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image36.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image_thumb37.png\" width=\"600\" height=\"522\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL <\/a>will display the usual authentication dialog. You\u2019ll get prompted for the credentials of an administrator, the usual username and password\u2026<\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image37.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image_thumb38.png\" width=\"600\" height=\"545\" border=\"0\" \/><\/a><\/p>\n<p>\u2026but if the user you entered is one for which you assigned the multi-factor authentication requirement, your authentication experience won\u2019t be over yet. The <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL <\/a>authentication dialog will show the following\u2026<\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image38.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image_thumb39.png\" width=\"515\" height=\"545\" border=\"0\" \/><\/a><\/p>\n<p>\u2026and your phone will buzz with a message. Reply back with your code\u2026<\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/WP_20130304_002.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"WP_20130304_002\" alt=\"WP_20130304_002\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/WP_20130304_002_thumb.jpg\" width=\"500\" height=\"888\" border=\"0\" \/><\/a><\/p>\n<p>\u2026and the authentication dialog will finally close. After a brief wait, the tool will inform you that the app configuration took place successfully.<\/p>\n<p><a href=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image39.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/image_thumb40.png\" width=\"600\" height=\"435\" border=\"0\" \/><\/a><\/p>\n<p>That means that the tool successfully called the Graph, which in turn means that it successfully got a token from <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL<\/a>.<\/p>\n<p>In summary. I just used old bits to take advantage of a new authentication flow &#8211; and a multi-factor one nonetheless. <span style=\"text-decoration: underline;\"><strong>Q.E.D.!<\/strong><\/span><\/p>\n<p>You know, I didn\u2019t really *need* to see this happening to know that <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL\u2019s <\/a>approach supported arbitrary server-driven auth, new authentication factors that weren\u2019t even considered at the library\u2019s inception, and so on; that\u2019s why we designed it the way it is. But still\u2026 having the chance to see that playing out exactly, I don\u2019t know\u2026\u00a0 it just makes me happy <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" alt=\"Smile\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2013\/03\/wlEmoticon-smile5.png\" \/><\/p>\n<p>Remember, both <a href=\"https:\/\/www.cloudidentity.com\/blog\/2012\/11\/20\/a-refresh-of-the-windows-azure-authentication-library-developer-preview-2\/\">AAL <\/a>and the phone based multifactor authentication are still in preview: don\u2019t miss the chance to give feedback!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ah, what a day! The news on the Windows Azure AD features in the Windows Azure portal were on fire today if you missed them, check this out before going any further. The phone-based multifactor authentication preview is probably my favorite new feature. For details, check out this walkthrough; but in a nutshell,\u00a0&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1627,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1630","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/1630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/comments?post=1630"}],"version-history":[{"count":3,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/1630\/revisions"}],"predecessor-version":[{"id":1631,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/1630\/revisions\/1631"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/media\/1627"}],"wp:attachment":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/media?parent=1630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/categories?post=1630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/tags?post=1630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}