<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MFA with the password grant]]></title><description><![CDATA[<p dir="auto">Can I use MFA with the password grant (resource owner password credentials grant)?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/1348/mfa-with-the-password-grant</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 22:12:40 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/1348.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Nov 2021 13:44:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MFA with the password grant on Mon, 10 Jun 2024 13:38:35 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for addressing this use case. Your proposal, however, runs counter to any standardization effort: Long live OAuth! <img src="https://fusionauth.io/community/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=rcgg4tg866g" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":-)" alt="🙂" /></p>
<p dir="auto">A better approach would be to switch from a password grant to the use of authorization codes (instead of passwords) to obtain the access token. This is fully within the OAuth framework and does not introduce fusionauth-specific hacks into the solution.</p>
<p dir="auto">We have created as simple html page that redirects to the fusionauth authorize endpoint with grant_type=authorization_code. The browser handles MFA as usual. Upon redirecting to this page, the page can harvest the authorization code for the user to copy. From there proceed with into authorization code in place of a password.</p>
<p dir="auto">PS: Long live OAuth!</p>
]]></description><link>https://fusionauth.io/community/forum/post/7337</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/7337</guid><dc:creator><![CDATA[admin b]]></dc:creator><pubDate>Mon, 10 Jun 2024 13:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to MFA with the password grant on Thu, 04 Nov 2021 13:48:00 GMT]]></title><description><![CDATA[<p dir="auto">Yes. While we recommend the Authorization Code grant is almost all situations, there are times when you need the password grant, and FusionAuth's MFA works with it just fine.</p>
<p dir="auto">When you begin the password grant, if the user has MFA set up, you won't receive the JWT on successful authentication. Instead you'll receive JSON like this:</p>
<pre><code>{"error":"two_factor_required","error_description":"The user has enabled two factor authentication.","two_factor_id":"gDNV2_fFtl7vhMV5_5bFJUL3ZyZ5Ine69n0xWDXKEGw"}
</code></pre>
<p dir="auto">You'll then need to use the provided <code>two_factor_id</code> to complete the MFA as documented here: <a href="https://fusionauth.io/docs/v1/tech/apis/login/#complete-multi-factor-authentication" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/login/#complete-multi-factor-authentication</a></p>
<p dir="auto">That might look something like this:</p>
<pre><code>curl https://local.fusionauth.io/api/two-factor/login -H 'content-type: application/json' -d '{"twoFactorId": "gDNV2_fFtl7vhMV5_5bFJUL3ZyZ5Ine69n0xWDXKEGw", "code": "487156"}'
</code></pre>
<p dir="auto">At that time you'll get a JWT and normal successful login response.</p>
]]></description><link>https://fusionauth.io/community/forum/post/3909</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/3909</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Thu, 04 Nov 2021 13:48:00 GMT</pubDate></item></channel></rss>