{"id":393193,"date":"2024-06-29T10:52:13","date_gmt":"2024-06-29T10:52:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=393193"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=393193","title":{"rendered":"<span>Easy Two Factor Authentication (2FA) with Microsoft Authenticator (2)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Some time ago <a href=\"https:\/\/habr.com\/en\/publication\/edit\/576200\/\" rel=\"noopener noreferrer nofollow\">we discussed<\/a> how to easy and fast setup 2FA using Google Authenitcator API. <\/p>\n<p>In this article we learn how to configure 2FA using Microsoft Authenticator:<\/p>\n<ol>\n<li>\n<p>Again, we download Microsoft Authenticator app from App Store or Google Play:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c96\/039\/815\/c960398153f860100c09f46d78040af0.png\" width=\"320\" height=\"568\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c96\/039\/815\/c960398153f860100c09f46d78040af0.png\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>Now we have Microsoft Authenticator app installed. Again, our next step would be to generate \u201csecret\u201d information and assign it to our account id. Don&#8217;t forget to subscribe to the API.<\/p>\n<\/li>\n<\/ol>\n<p>This time we will be using \/new_v2\/ endpoint instead of \/new\/. The difference is that \/new_v2\/ returns only secret key without any additional comments. So far, create a \/new_v2\/ request in Postman and provide url and X-Rapidapi-Key, again no additional parameters needed (see details here\u00a0<a href=\"https:\/\/rapidapi.com\/chdan\/api\/otp-authenticator\" rel=\"noopener noreferrer nofollow\">https:\/\/rapidapi.com\/chdan\/api\/otp-authenticator<\/a>). <\/p>\n<p>After successful execution of the \/new_v2\/ endpoint you\u2019ll see your new secret value:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c6\/331\/cc3\/2c6331cc3620f3294773d32192918813.PNG\" width=\"1013\" height=\"489\"\/><\/figure>\n<ol start=\"3\">\n<li>\n<p>Save this secret value, add \u201caccount\u201d and \u201cissuer\u201d into our next \/enroll\/ endpoint. After successful execution of \/enroll\/ service you will have url link generated, so that your users could add this info to Microsoft Authenticator app:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/23d\/0e8\/a41\/23d0e8a41199208ce4e2b5be8c929e45.png\" width=\"1009\" height=\"506\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/23d\/0e8\/a41\/23d0e8a41199208ce4e2b5be8c929e45.png\"\/><\/figure>\n<ol start=\"4\">\n<li>\n<p>Now let\u2019s open this url and scan the QR code:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f29\/1df\/556\/f291df556c1d020f0bb656d78bf43c03.PNG\" width=\"865\" height=\"752\"\/><\/figure>\n<p>Use \u201cScan a QR code\u201d button in Microsoft Authenticator (first push \u201c+\u201d button):<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/032\/7c0\/310\/0327c03107f4c7984230dbf5b2305305.PNG\" width=\"320\" height=\"568\"\/><\/figure>\n<ol start=\"5\">\n<li>\n<p>Done! After we synced Microsoft Authenticator app with your server\u2019s secret, Microsoft Authenticator starts generating time-based one-time passwords (TOTP):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9fd\/84d\/833\/9fd84d8332fc446ccb0f7cc71fc18117.PNG\" width=\"320\" height=\"568\"\/><\/figure>\n<ol start=\"6\">\n<li>\n<p>Now we can validate one-time passwords (TOTP) on our end using \/validate\/ service:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f45\/343\/aa4\/f45343aa4678fd913c72380cbb4db1f7.PNG\" width=\"1009\" height=\"485\"\/><\/figure>\n<p>\u201cTrue\u201d value indicates a correct entry. After 60 seconds the same request would return \u201cFalse\u201d value.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/662646\/\"> https:\/\/habr.com\/ru\/articles\/662646\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Some time ago <a href=\"https:\/\/habr.com\/en\/publication\/edit\/576200\/\" rel=\"noopener noreferrer nofollow\">we discussed<\/a> how to easy and fast setup 2FA using Google Authenitcator API. <\/p>\n<p>In this article we learn how to configure 2FA using Microsoft Authenticator:<\/p>\n<ol>\n<li>\n<p>Again, we download Microsoft Authenticator app from App Store or Google Play:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>Now we have Microsoft Authenticator app installed. Again, our next step would be to generate \u201csecret\u201d information and assign it to our account id. Don&#8217;t forget to subscribe to the API.<\/p>\n<\/li>\n<\/ol>\n<p>This time we will be using \/new_v2\/ endpoint instead of \/new\/. The difference is that \/new_v2\/ returns only secret key without any additional comments. So far, create a \/new_v2\/ request in Postman and provide url and X-Rapidapi-Key, again no additional parameters needed (see details here\u00a0<a href=\"https:\/\/rapidapi.com\/chdan\/api\/otp-authenticator\" rel=\"noopener noreferrer nofollow\">https:\/\/rapidapi.com\/chdan\/api\/otp-authenticator<\/a>). <\/p>\n<p>After successful execution of the \/new_v2\/ endpoint you\u2019ll see your new secret value:<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"3\">\n<li>\n<p>Save this secret value, add \u201caccount\u201d and \u201cissuer\u201d into our next \/enroll\/ endpoint. After successful execution of \/enroll\/ service you will have url link generated, so that your users could add this info to Microsoft Authenticator app:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"4\">\n<li>\n<p>Now let\u2019s open this url and scan the QR code:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<p>Use \u201cScan a QR code\u201d button in Microsoft Authenticator (first push \u201c+\u201d button):<\/p>\n<figure class=\"\"><\/figure>\n<ol start=\"5\">\n<li>\n<p>Done! After we synced Microsoft Authenticator app with your server\u2019s secret, Microsoft Authenticator starts generating time-based one-time passwords (TOTP):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><\/figure>\n<ol start=\"6\">\n<li>\n<p>Now we can validate one-time passwords (TOTP) on our end using \/validate\/ service:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<p>\u201cTrue\u201d value indicates a correct entry. After 60 seconds the same request would return \u201cFalse\u201d value.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/662646\/\"> https:\/\/habr.com\/ru\/articles\/662646\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-393193","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/393193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393193"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/393193\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}