# Multifactor authentication with rotating refresh

**URL:** <https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627>\
**Category:** Get Help\
**Tags:** auth0-spa-js, refresh-tokens, mfa\
**Created:** [July 20, 2020, 9:44pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627 "2020-07-20T21:44:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony.konschuh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anthony.konschuh/32/12751_2.png) [@anthony.konschuh](https://community.auth0.com/u/anthony.konschuh)\
**Post date:** [July 20, 2020, 9:44pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/1 "2020-07-20T21:44:37Z")

</div>

I’m trying to implement the rotating refresh token with my single page app using the auth0-spa-js SDK. Everything was working until I enabled MFA for the user I was testing with. Now when it tries to silent auth with the refresh token grant it fails with 403 “Multifactor authentication required”, then falls back on the authorization code grant and authorizes successfully. I was wondering if this is expected behavior because MFA and rotating refresh are incompatible or if I should be looking for issues with my implementation?

---

<div class="post-metadata">

**Author:** ![kstrongholte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kstrongholte/32/16354_2.png) [@kstrongholte](https://community.auth0.com/u/kstrongholte)\
**Post date:** [July 21, 2020, 9:22pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/3 "2020-07-21T21:22:02Z")

</div>

Hi Anthony,

Welcome to the Auth0 community!

Have you tried setting `useRefreshTokens` to `true` on your Auth0 client initialization?

> **[Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk)**
>
> Auth0 SDK for single page applications using Authorization Code Grant Flow with PKCE.

---

<div class="post-metadata">

**Author:** ![anthony.konschuh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anthony.konschuh/32/12751_2.png) [@anthony.konschuh](https://community.auth0.com/u/anthony.konschuh)\
**Post date:** [July 21, 2020, 9:30pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/4 "2020-07-21T21:30:41Z")

</div>

Yes. I have the rotating refresh working. The problem happens when I enable multifactor authentication. When I am logged in as a user that is already multifactor authenticated, it tries to silent auth with the refresh token and gets the aforementioned 403, then reattempts the silent auth with the authorization code and succeeds.

---

<div class="post-metadata">

**Author:** ![kstrongholte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kstrongholte/32/16354_2.png) [@kstrongholte](https://community.auth0.com/u/kstrongholte)\
**Post date:** [July 21, 2020, 10:35pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/5 "2020-07-21T22:35:39Z")

</div>

After they’ve successfully authenticated via authorization code, does it fail the _next_ time it tries to silently authenticate?

---

<div class="post-metadata">

**Author:** ![anthony.konschuh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anthony.konschuh/32/12751_2.png) [@anthony.konschuh](https://community.auth0.com/u/anthony.konschuh)\
**Post date:** [July 21, 2020, 10:43pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/6 "2020-07-21T22:43:08Z")

</div>

Yes. It tries to use the refresh token again, fails in the same manner, falls back to authorization code, succeeds, and then repeats for every silent authentication until I turn Multifactor authentication off.

---

<div class="post-metadata">

**Author:** ![hali](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hali/32/28441_2.png) [@hali](https://community.auth0.com/u/hali)\
**Post date:** [March 29, 2021, 12:10pm UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/7 "2021-03-29T12:10:18Z")

</div>

Hi

I am also having the same problem. can some one guide me, how to get around this?

Thanks  
Habib Ali

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 30, 2021, 10:27am UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/8 "2021-03-30T10:27:34Z")

</div>

@kstrongholte are you able to follow up on that?

---

<div class="post-metadata">

**Author:** ![shashankboosi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shashankboosi/32/36778_2.png) [@shashankboosi](https://community.auth0.com/u/shashankboosi)\
**Post date:** [April 21, 2022, 4:58am UTC](https://community.auth0.com/t/multifactor-authentication-with-rotating-refresh/46627/9 "2022-04-21T04:58:18Z")

</div>

I am facing the same issue. Any updates or fix for this yet ?
