I am developing a JSS application (NextJS), and this app is only accessible to the internal staffs. And everyone must authenticate via Azure AD authentication to access the content. Typically for React/Angular, I would use MSAL library to authenticate.

But how do I do this with JSS app? I have successfully create one JSS app with MSAL library but I'm not able to edit the content from Experience Editor, it will keep on looping the authentication cycle. It is working when I access the rendering server directly.

1 Answer 1


With Next.js, you can use a tool like NextAuth.js to add authentication. NextAuth.js has providers for Azure Active Directory and Azure Active Directory B2C.

This would be enabled for your rendering host that is delivering your public website. Normally you should have a separate rendering host configured for editing. The authentication would then be disabled for editing which would enable Experience Editor to work correctly.

  • Hi Richard, thanks for the answer. But if we disable the authentication for editing, how do we customise the content to target certain users? Since the authentication has been disabled. Commented Jan 11 at 3:35
  • I would have thought your content editors would need to see all the content for editing?
    – Richard Seal
    Commented Jan 11 at 16:27
  • If possible, I would like to be able to masquerade as certain user to customise the content based on their roles. For example, user A should see different banner than user B. Or user A should have different navigation bar options than user B. I understand that we can do per page level restriction, but can we do this on content/renderings level? Commented Jan 12 at 2:14
  • What you are looking for would require considerable customization to Experience Editor I think, and it would not be possible in Pages at all.
    – Richard Seal
    Commented Jan 12 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.